Ich habe eine einfache Methode, die es am Ende ich an eine andere Komponente umleiten möchten:Redirect innerhalb Komponente Angular 2
export class AddDisplay{
display: any;
addPairTo(name: string, pairTo: string){
this.display = {};
this.display.name = name;
this.display.pairTo = pairTo;
}
}
Was ich tun will ist am Ende des Verfahrens auf eine andere Komponente umleiten:
export class AddDisplay{
display: any;
addPairTo(name: string, pairTo: string){
this.display = {};
this.display.name = name;
this.display.pairTo = pairTo;
this.redirectTo('foo');
}
}
Wie erreiche ich dies in Angular 2?
Ich kann nur an Routing denken. Du kannst das mit [navigate] tun (https://angular.io/docs/js/latest/api/router/Router-class.html) –