I need to get the id for updating a field in angular

How can I get the id of a task in my todo app without using ActivatedRoute method for updating functionality in angular ?

this.route.paramMap.subscribe(params => {this.id = params.get('id');})

this is the way which I’m using now

>Solution :

If you don’t want to use ActivatedRoute you need to store the id in a service or in the localStorage before changing page, so in the new page you can retrieve it.

Leave a Reply