Relative Content

Tag Archive for angularcomponentsrouter

Router Appending component instead of replacing it – Angular 18

I am working on a web app, a very simple one.
I have implemented a base component which has the header, the footer, the lateral menu and all the components I want on all the pages. The page is a component inside the base one. My problem is that when trying to redirect the component by click the lateral menu in the base component, the requested component is appended instead of replacing the previous one. I’ve had this issue since this morning and I have no idea where it comes from.

Why when I use it? then the path in the component header does not work

I have written an a tag as follows in the component header
user list
and then I use it in app.component as follows
When using this, the a tag doesn’t work, I click on the a tag and nothing happens
nhưng khi viết thẻ a trực tiếp trong app.component.html như thế này thì nó lại hoạt động được