Angular 2 Router and OnActivate

0 views
Skip to first unread message

John Baird

unread,
Jun 13, 2016, 1:37:28 PM6/13/16
to Angular2
I'm trying to setup a component to use the routerOnActivate hook, but am getting an error "that property routerOnActivate is missing in component....'.

import {Component} from '@angular/core';
import {Routes, RouteSegment, RouteTree, ROUTER_DIRECTIVES, OnActivate} from '@angular/router';
import {SettingsProfileComponent} from '../profile/settings.profile.component';

@Component({
    selector: 'kg-Settings ',
    templateUrl: './app/components/settings/home/settings.home.component.html',
    directives: [ROUTER_DIRECTIVES]
})

export class SettingsHomeComponent implements OnActivate{
 public isSettingsHome: boolean = false;
  
  routerOnAcivate(curr: RouteSegment, prev?: RouteSegment, currTree?: RouteTree, prevTree?: RouteTree) :void {
       
   }
}

Can anyone see the error or tell me what is wrong here... 

Thanks in advance.
Reply all
Reply to author
Forward
0 new messages