[
{
"path": "users",
"component": "views.UserTreeView"
}
]@Injectable()
export class NavigationService {
constructor(private http: Http) {
}
loadRoutes(): Observable<Routes> {
debugger;
return this.http.get(navigationUrl)
.map((r: Response) => r.json())
.map((items: Array<any>) => {
return items.map(i => <any>{ path: i.path, component: i.component })
});
}
}ngOnInit() {
// Маршруты
this.navigationService
.loadRoutes()
.subscribe(routes => {
this.router.resetConfig(routes);
this.router.navigate(['users']);
});
}--
You received this message because you are subscribed to a topic in the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/L_S3c5CD6aY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.