を経由して自分のアプリケーションのAOTを構築角度-CLI角度2 AOTビルド - 必要な問題
すなわち(ngの構築--aot --prod)
私は次のエラー受け付けております:
を..app>ng build --prod --aot
10% building modules 2/2 modules 0 active Error encountered
resolving symbol values statically. Calling function 'require',
function calls are not supported. Consider replacing the function
or lambda with a reference to an exported function, resolving symbol
appComponent in ..app.component.ts, resolving symbol AppComponent
in ..app.component.ts
私のコンポーネントは次のようになります。
@Component({
selector: 'app-component',
template: `
...
<div class="centered">
<img [src]="logo">
</div>
....
`,
styles: [require('./app-component.component.css')]
})
export class LoginComponent {
private logo = require('./logo.png');
...
}
利用可能な回避策はありますか?
関数呼び出しはサポートされていません。
コンポーネントのクラスは、関数へ –
スニペットを私に提供できますか?私は新しいコンポーネントを作成して、次のようなことをしようとしました:export var logo = require( './ logo.png');それはどちらもうまくいかなかった。 – kazanDipi