I am trying to navigate from a component to another but i got this problem :Invalid configuration of route ”: redirectTo and children cannot be used together. How can i fix it please? route file : html file when i am invoking method to navigate to the OffreMngmntSitesListAllComponent component: and the ts file of when i have the method that
Tag: angular
How to access array elements in angular
From an API, I’m trying to get data using httpModule. Here is my code When I use async and await, it says that await has no effect. An undefined is getting assigned to the variable this.output. How can I make this work? Also, How can I get access to a variable from the below response array? here I need to
Angular doesn’t update view on array push
I have an issue with a function which loads posts with the ionic infinite scroll component. The function works great on other components but in this one, the view doesn’t update when I push new posts into the array. This is the function that doesn’t work: This is the one that works: Here is the html: I’m new to this
angular http interceptor not calling request again after token refresh
I have a http interceptor in my project, it handles the refreshing of the access token. When a user’s access token expires the request will get a 401 error, in that case, this function should handle everything, refreshing the token and calling the request again, with the new access token. Here is the calling of the function: And the handle401:
Highlight specific words in textarea angular 8
I am trying to select a few words from the textarea and create bootstrap chips. I am able to create the chips for selected words. I am trying to highlight the selected words with different background colors. I am not sure how to highlight the words in the selectedText array. I want to highlight all chip words. Like “Contrary”, “Ipsum”,
convert js into typescript into angular 8
Below code is working fine in javascript. But when i tried the same in Angular 8 I am getting lot of error Errors signUpButton.addEventListener(‘click’, () => { ~ error TS1003: Identifier expected. please let me know how to convert this into Typescript Answer In Angular, It’s better to not use eventListeners rather use event binding in your HTML code. Your
Angular Date Picker is always invalid
I have an angular date picker within a reactive form with a required validator. The problem is that it is always not valid, even when a date is picked. Strangely the control does not display red when it is invalid. Do I need to do some manual css rules for this? HTML and Typescript below. A stackblitz of the issue
how to run subscribe sequentially in observable
I want to run code sequentially but I was wondering how this works, for example, I have a method that includes two observable and some fields. I want to run the first observable completely then the next field values check and after that the last observable method: but at the current stage step 2 completed first and step 3 next
Javascript cannot change the value of mydata
I have this code: And after I try to add some values: I keep getting: How can I fix this? Answer You can’t set a property on null. You need to assign an object to your variable first: Or all in one go:
Error: Expected a validator to return Promise or Observable
I’m trying to do custom validation on Angular 10 but I’m facing the following error. I just want to return an error to the form if the value doesn’t match the required, here’s my code: This is the component where my form is Does that type of validation only work with observables or can I do it without being a