angular - CanActivate is giving error after switching to r.c.3 -


i using canactivate in angular2 app this

@canactivate(() => isvaliduser())

it working fine until switched r.c.3 , started giving me error.

please suggest me recent changes regarding property.

you create auth.guard.ts in app folder:

app/auth.guard.ts:

import { canactivate }    '@angular/router';  export class authguard implements canactivate {   canactivate() {     console.log('authguard#canactivate called');     return true;   } } 

then in routes.ts:

{   path: 'admin',   component: yourcomponent,   canactivate: [authguard] }, 

if don't have routes.ts, need create one, see reference here: https://angular.io/docs/ts/latest/guide/router.html


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -