Search code examples
angularangular4-router

Tab Route Change


I have angular tab

<tab (select)="goTo('materials')" id="materials"></tab>

component goTo(url) { this._router.navigate([url], { relativeTo: this.route }); }

in another tab "general" i have a link redirect to this "material" tab but when i click it it redirect to the right link and load the corresponding view but the tab name "general" hasn't changed

<i (click)="goto('../general')"></i>

component : goto(tabname){ this.router.navigate([tabname], { relativeTo: this.route }); }


Solution

  • I created a Event emitter to connect the two component to trigger (select) method in the parent component