angular 7 getting ActivatedRoute params not working angular 7 getting ActivatedRoute params not working angular angular

angular 7 getting ActivatedRoute params not working


Try accessing the param in the following way instead by accessing this param from the resolved value of the paramMap observable stream rather than the snapshot:

ngOnInit() {  this.route.paramMap.subscribe(    (params: ParamMap) => {      this.currentLang = params.get('lang');    }  )}

This is effectively how the official documentation describes working with params

You could always pass the observable stream ParamMap value to the helper function if you wanted for style purposes

Hopefully that helps!