I added this but when inspecting element using Chrome DevTools, the click function doesn\'t show!
Here\'s my code:
If some body needs to use a router link you can do it like bellow:
you should create a route to match the link, for example:
const routes: Routes = [
{
path:'editnews/:newsfeedid', component:NewsfeedformComponent
}
]
If you want to get the id from url in your component, under ngOnInit use ActivatedRoute like bellow:
import { ActivatedRoute } from '@angular/router';
ngOnInit() {
this._activatedRoute.paramMap.subscribe(params => {
// in the route we created edit route we set newsfeedid as param so we get it here
const NewsfeedID = +params.get('newsfeedid');
if (NewsfeedID) {
//this.getAgentbyid(agentid);
console.log(NewsfeedID);
}
})
}