Relative Content

Tag Archive for htmlangular

Angular – @ViewChild with component variable

I am rendering the same component on two different Router routes. Since it is one component both instances would have the same template reference variable. It seems like that create a problem that is outside of this post, however, to test it, I want to have two different reference variables for the templates. so, I am thinking to use component variables for reference variables. Something like this:

mat sort header not working with the column created

I’m facing difficulties implementing a date filter in a table using Angular Material. The dates are retrieved from an API in the format “YYYY-MM-DD”, all the columns are working except the created

ngFor item div toggle class on click

I have a ngFor where it gets the static data from the .ts file, I’m trying to add active class on the selected item, the issue is as it is in ngfor it toggles class on every item on the list. How can I add active class to the selected item?