I can not get the route parameters in angle 5

1

Every time I try to get the parameters of a route I get an empty object

component :

ngOnInit() {
        this.route.params.subscribe(
            params => {
                this.token = params
                console.log(this.token)
            }
        )
}

routing-module :

const appRoutes: Routes = [
    { 
        path: 'recuperar-senha/:token',
        component: RedefinirSenhaComponent
    }
]

The result of the component log is always an empty object and my biggest question is, can this be caused by route authentication?

    
asked by anonymous 02.05.2018 / 22:02

0 answers