Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

angular url parameter

// example url: details?id=2

constructor(private activatedRoute: ActivatedRoute) {
  this.activatedRoute.queryParams.subscribe(params => {
        console.log(params); // Prints {id: "2"}
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #url #parameter
ADD COMMENT
Topic
Name
8+1 =