0
你好,我是新來的角2,學習,試圖建立路線。Angular2 404 GET/traceur
app.routing.ts
import {FormApp} from './app.form';
import {Routes, RouterModule} from '@angular/router';
const appRoutes = [
{path:'form',component:FormApp},
{path:'all',pathMatch:'full',redirectTo:'all'}
];
export const routing = RouterModule.forRoot(appRoutes);
**app.module.ts**
import {NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {AppComponent} from "./app.component";
import {AppMedia} from './app.media';
import {FavoriteDirective} from './app.fav.directive';
import { CustomPipe} from './app.pipe';
import {ReactiveFormsModule} from '@angular/forms';
import {FormApp} from './app.form';
import {Service} from './app.service';
import {varijablaTok, varijabla} from './app.tok';
import {routing} from'./app.routing';
const data = {velicina:['M','S','XXL']};
@NgModule({
imports:[BrowserModule, ReactiveFormsModule,routing],
declarations:[ AppComponent, AppMedia, FavoriteDirective, CustomPipe, FormApp],
bootstrap:[ AppComponent],
providers:[Service,{
provide: 'varijablaTok' ,useValue :varijabla
}]
})
export class AppModule {}
和HTML文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p id="par">Bozic je sevaju prangije i cesnicu baka sprema</p>
<media-app [ngClass]="{'crveno ' : n.name === 'Firebug','plavo' : n.name ==='The Redemption' }" *ngFor="let n of xxx" (delete)="naDeletu(mediaItem)" [mediaItem]="n"></media-app>
<select>
<option *ngFor="let d of varijabla.velicina">{{d}}</option>
</select>
<router-outlet></router-outlet>
</body>
</html>
我想使用的路由器出口標籤航線formApp成分,但我有錯誤無法獲得/traceur.Am我做錯事我是新來angular2幫助是必要的。 tnx i advance