I make a two different component of angular 2 .I am learning routing from this link https://angular.io/docs/ts/latest/tutorial/toh-pt5.html
I make two component .In first component I have one button I want to move to move to second component
here is my code https://plnkr.co/edit/GBOI9avZaPGaxaLQbtak
I define routes like that
const routes =[
{
path: 'ft',
component: First
},
{
path: 'sd',
component: Second
}
]
@NgModule({
imports: [ BrowserModule ],
declarations: [ App ],
bootstrap: [ App,First ,Second]
})
I am using <router-outlet>
but I am not able to move one component to another
There you go :
https://plnkr.co/edit/wIuaffLskQd8GJuqLlY6?p=preview
You had heaps of errors :D
Anyway , in order to navigate to another route , you'd need to use router