在Angular 2应用上运行UglifyJs,收到错误消息
Can't bind to 'ngforOf' since it isn't a known property of 'a'
以下是一些来自配置的摘录:
module: {
preLoaders: [{
test: /\.ts$/,
loader: 'tslint'
}] ...
plugins: [
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
}
})...
htmlLoader: {
minimize: false // workaround for ng2
}
在模板套管中是正确的 - 它是ngFor
,资本'F` - 显然UglifyJs正在降低它?
a(*ngFor='let language of languageList', (click)='selectLanguage(language)') {{language}}