私は角型アプリケーションを持っています。このアプリケーションを開発環境(npm run build
)でビルドすると完全に正常に動作します。生産を構築するためにangular-cliコマンドを実行することができません
しかし、私は本番タグでビルドしようとすると、それがこのエラーで失敗します。
C:/Users/1234/app/src/$$_gendir/app/app.component.ngfactory.ts (617,85): Property 'router' is private and only accessible within class 'AppComponent'.
、私は、ルータが(下記のコードで)プライベートですけど、それは開発インスタンスのために正常に動作しているかとなしAppComponent.htmlはそれを使用できるはずですか?
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(private router: Router, private _cookieService:CookieService) {
//some function
}
}
ここに報告されているその他の問題:https://github.com/angular/angular/issues/15451 – undefined
あなたのテンプレートで直接 'router'にアクセスしますか? – jonrsharpe
はい..テンプレートに直接ルータを使用しています。app.component.html – undefined