Я использую Angular 8 и модуль HttpClientJsonpModule. Вот моя пользовательская функция выборки:
public fetch(): Observable<any> {
// This url has been obfuscated but you get the gist. This is the expected format so I can't alter the string
const url = 'http://exampleurl:6000/GetSomeData(inputParams=@test1)?@test1={hasData=true}';
return this.http.jsonp(url, 'callback')
.pipe(
map(response => {
// always returns null
console.log(response);
})
);
}
Когда я вызываю this.fetch()
, всегда возвращается следующая ошибка:
Внедренный сценарий JSONP не вызывал обратный вызов.
И response
всегда равен нулю. Я где-то пропускаю шаг?