0
由於某種原因,--prod
cli標誌從編譯輸出中刪除了導航欄。任何想法爲什麼?ng build --prod刪除導航欄
我app.component看起來是這樣的:
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
@Component({
selector: 'app-root',
template: `
<nav-bar></nav-bar>
<router-outlet>
</router-outlet>`,
directives: [ROUTER_DIRECTIVES]
})
export class AppComponent {}
我的導航欄組件:
import { Component, OnInit } from '@angular/core';
import { GlobalEvent } from '../shared/global.event'
import { Http, Response } from '@angular/http';
@Component({
selector: 'nav-bar',
templateUrl: 'navbar.component.html',
providers: [GlobalEvent],
styleUrls: ['navbar.component.css'],
})
export class NavbarComponent implements OnInit {
...
}
注:與--dev
標誌工程建設按預期。我希望這不是一個cli問題。