를 통해 내 응용 프로그램의 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