grumar / adal-angular5

Angular 5 ADAL Wrapper
MIT License
12 stars 19 forks source link

options in Adal5HttpService.get() #21

Open leonixyz opened 6 years ago

leonixyz commented 6 years ago

Hi,

each time i GET something using class Adal5HttpService the ts compiler refuses to do its job if I don't pass parameter options:

  get(url: string, options: {
    body?: any;
    headers?: HttpHeaders;
    reportProgress?: boolean;
    observe: 'response';
    params?: HttpParams | { [param: string]: string | string[]; };
    responseType?: 'json';
    withCredentials?: boolean;
})

In the simplest case, where I don't have any option to set, the compiler still refuses to work if I don't set options to {'observe': 'response'}

I'm new to angular but this seems pretty odd to me, why should i pass a fixed object? wouldn't be possible in case that parameter is omitted to set some default value in Adal5HttpService itself?

edit: could this be fixed by changing the method signature adding an ? after observe? or after options?

thanks in advance