Bir sonraki sorunum var: Cannot read property 'outlets' of null
. Projem işe yarıyor, ancak bir süre sonra çalışmayı bıraktı, ancak kodumu değiştirmedim. Bana yardım et lütfen.
Güncelleme
yönlendirici-çıkış ile Benim bileşen:Öğenin 'outlets' değeri okunamıyor
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '
<nav-menu></nav-menu>
<router-outlet></router-outlet>
<footer-component></footer-component>
',
})
export class AppComponent {}
app.module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { LocationStrategy, PathLocationStrategy, APP_BASE_HREF } from '@angular/common';
import { HttpModule } from '@angular/http';
import {FormsModule,ReactiveFormsModule} from '@angular/forms';
//+components
@NgModule({
imports:
[
BrowserModule,
HttpModule,
FormsModule,
ReactiveFormsModule,
RouterModule.forRoot([
{ path: '', component: HomeComponent },
{ path: 'home', component: HomeComponent },
{ path: 'blog', component: BlogComponent },
{ path: '2016/:link', component: BlogArticleFullComponent },
{
path: 'admin', component: AdminComponent,
children: [
{ path: 'new', component: NewArticleComponent },
{ path: 'new-writer', component: NewWriterComponent },
{ path: 'new-tag', component: NewTagComponent }
] },
{ path: '**', redirectTo: '', pathMatch: 'full'}
])
],
declarations:
[//components
],
bootstrap:
[
AppComponent
],
providers:
[
{ provide: APP_BASE_HREF, useValue: '/' },
{ provide: LocationStrategy, useClass: PathLocationStrategy }
]
})
export class AppModule { }
Not; 'Alıntı', çünkü -over koduna karşı `quote 'var.
StackOverflow'a Hoş Geldiniz. Sorunu bu bilgiyle tanıyan kimsenin yolu yoktur. –
Bize bir kod göster… bölüm 'outlets' aradığınız yer –
hangi kodu görmek istiyorsunuz? 2838 2) core.umd.js: 2843 3) core.umd.js: 2844 4) Subscriber.ts: 241 – roma9806mail