2,117 questions
1
vote
0
answers
38
views
Resolve promise in a typescript non async function [duplicate]
I have a typescript file with the following non async function.
export function MSALInstanceFactory(): IPublicClientApplication {
const environmentService = new EnvironmentService();
const ...
0
votes
1
answer
68
views
How to return promise in partially async function [closed]
I have a function that goes like this:
async function(field1, field2) : Promise<boolean> {
if(aCondition) {
await nestedFunc().then(doSomethingwithDataFromAwait()
return true;
...
0
votes
0
answers
58
views
Angular: Loading Indicator Stuck When Using Promises in Parent-Child Component
I am working on an Angular app (version 17). I have a parent component with two child components. On my page, I want to ensure that the content won't be displayed until all the data (from both the ...
1
vote
1
answer
953
views
Angular HttpClient calls and signals
I am diving deep into signals watching tutorials and reading articles. When calling an api endpoint with httpClient I've seen two main approaches (at least that I liked) and I am unable to find much ...
1
vote
1
answer
111
views
Promise.all() never resolving
I have a function which should get some data asynchronously.
getPageEvents() {
const promises = this.calendarPage.days.map(day => {
return this.dataService.getEventsByDay(day)
....
0
votes
1
answer
1k
views
Angular - Error RangeError: Maximum call stack size exceeded. after removing distinctUntilChanged() from a fromControl value change subscription
I have two angular components a parent and a child, both with their own form fields.
I setup change listeners in both components to listen to the form control value changes and disable some fields ...
1
vote
0
answers
113
views
Alternative to toPromise with downgradeInjectable
A service I've written in Angular is being consumed in a third party angularJS application. My pattern has been: create a service method which returns Observable<someType> and then create a ...
0
votes
1
answer
380
views
Angular assign value inline in click from an async function
I have a pretty unique situation of assigning value to a variable inline using click event via an async function call. I have ng-template-for where a deeply nested and complex set of object is ...
3
votes
2
answers
11k
views
How to change an observable http request to promise request
This is my service file
This is my components ts file
And these are response models
I am having issues with displaying the data I'm fetching through an Observable-based service in my TypeScript file ...
0
votes
1
answer
525
views
Angular: RouterGuards, HTTP requests and race conditions
I'm trying to create a RouterGuard in Angular that gets a response from the backend about the User's login status. The problem is that the HTTP request returns a Subscription with async concrete ...
0
votes
1
answer
351
views
execute a sequence of GET calls to an API wait and do some treatments on the results then give the result as argumant to another methode for a POST
I am new to Angular and i am facing some difficulties with a task. I have an array of IDs that i want to execute the same GET Call over. And for every GET call result i have to do some operations and ...
0
votes
2
answers
1k
views
Cannot read properties of undefined (reading 'get') at get xyzArray [as xyzArray] Angular 14
I'm trying to implement FormArray into my project to generate dynamic FormControls.But I'm stuck at this error which I'm not able to understand.Whenever I create a getter method to get my array from ...
0
votes
3
answers
265
views
How to call Promise inside Promise and call function 2 times at a time in javascript
My code scenario is like :-
async function ot(a: any) {
return "outer text " + a;
}
async function it() {
return "inner text";
}
function insert() {
it().then(res =&...
0
votes
0
answers
14
views
Why does $q.when() promise chaining not work inside a while loop? [duplicate]
I was trying to chain a bunch of API calls based on a specific max count, until the offset specified for the API call does not exceed the max count. The offset is intended to increase by a constant ...
2
votes
1
answer
3k
views
How to handle .toPromise() deprecation with RXJS and Angular 13
Hello I'm trying to figure out how to handle this deprecation on this code
const authCtx = (auth: AngularFireAuth) =>
setContext(async () => {
const token = await auth.idToken.pipe(take(1))...