要素ではありませんルータ-アウトレットは、既知の
/*index.html*/
<head>
<base href="/">
/*app.module.ts*/
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { LetterRecall } from './letterRecall/letterRecall.component';
@NgModule({
imports: [BrowserModule,
HttpModule,
RouterModule.forRoot([
{ path: 'letters', component: LetterRecall }
])],
declarations: [AppComponent, LetterRecall],
bootstrap: [AppComponent],
})
export class AppModule {}
/*app.component.ts*/
import {Component} from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: 'app/app.component.html'
})
export class AppComponent { }
/*app.component.html*/
<h3>Title</h3>
<a routerLink="/letters">Letters</a>
<router-outlet></router-outlet>
:私は自分のコードを修正
https://angular.io/docs/ts/latest/tutorial/toh-pt5.html
この時点で私は次のエラーを受け取ります:
"Unhandled Promise rejection: Template parse errors: 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module. ....."
私は次のバージョン使用しています:SOに規定され、私はこれをやっている、あなたは上記を参照できるように私はRouterModuleをインポートする必要がなく、指示に他の回答のすべて
"@angular/common": "2.4.0",
"@angular/compiler": "2.4.0",
"@angular/core": "2.4.0",
"@angular/forms": "2.4.0",
"@angular/http": "2.4.0",
"@angular/platform-browser": "2.4.0",
"@angular/platform-browser-dynamic": "2.4.0",
"@angular/router": "3.4.0"
をチュートリアル。
このエラーの原因をどこから探すことができますか? PluralSightでJohn PapaのFirst Lookチュートリアルを使い始めましたが、コードは少し古いようです。それは私がすべてを取り除き、チュートリアルを通して裸の骨に行きました、そして、私はこのエラーを受けます...私は次にどこに向かうべきかわかりません。
は表示されません。 –
私はその枝を隠して始めました。私が見つけることができる唯一の変更は、zone.jsのバージョンを0から更新したことです。6.23〜0.7.2。私はこれが関連しているとは思わないが...今は機能する。 私はその秘密に戻ってあなたの提案を試みるかもしれませんが、この時点で私はこれをグレムリンまでチョークすることができると思います。 –