Answers for "get data from URL in angular"

0

get data from URL in angular

ngOnInit() {
    // first way
    this.userType = this.route.snapshot.queryParamMap.get("userType");
    this.list = this.route.snapshot.queryParamMap.get("list");
    // second way
    this.route.queryParamMap.subscribe(queryParams => {
       this.userType = queryParams.get("userType");
       this.list = queryParams.get("list");
    })
}
Posted by: Guest on September-03-2021

Code answers related to "get data from URL in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language