I have a hybrid app which is actually upgraded from AngularJS to Angular 11 and some modules are still in progress to be upgraded.
So to route to an Angular 11 module from AngularJS I am using:
$state.go('checkuser', {userid: userid});
Now I want to catch userid
in my component HTML and in my TypeScript file, but I'm unable to find a way to do so.
Here is how I am trying to catch the variable:
import { Component, OnInit } from '@angular/core';
import {StateService} from '@uirouter/angularjs';
@Component({
selector: 'ts-checkuser',
templateUrl: './checkuser.component.html',
styleUrls: ['./checkuser.component.scss']
})
export class checkuserComponent implements OnInit {
constructor(private $state: StateService) {
}
ngOnInit(): void {
console.log(this.$state);
}