Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

get query params from url angular

import { ActivatedRoute } from '@angular/router';

export class ExampleComponent implements OnInit {

  constructor(private router: ActivatedRoute) { }

  ngOnInit() {
    this.router.queryParams.subscribe(res=>{
      console.log(res) //will give query params as an object
    })
  }

}
 
PREVIOUS NEXT
Tagged: #query #params #url #angular
ADD COMMENT
Topic
Name
1+6 =