Answers for "angular get last part of url"

0

get current url last part angular

constructor(private route: ActivatedRoute){}
        
           ngOnInit() {
              this.route.parent.snapshot.url[2].path;
           }
Posted by: Guest on April-26-2021
-1

javascript get last url segment

console.log(this.href.substring(this.href.lastIndexOf('/') + 1));
Posted by: Guest on December-14-2020

Code answers related to "angular get last part of url"

Code answers related to "Javascript"

Browse Popular Code Answers by Language