私は制作のために自分のコードを小型化しようとしています(開発モードでwebpackを実行するとすべてうまく動作します)。主な違いはUglifyJsPlugin
プラグインです。私はそのプラグインで私のプロジェクトに奉仕するとき、私はJSコンソールでこれを取得:@InputデコレータとUglifyJsPluginのベリファイ
polyfills.b0a99d4.bundle.js:5 Unhandled Promise rejection: Template parse errors:
Can't bind to 'articles' since it isn't a known property of 'feed-grid'.
1. If 'feed-grid' is an Angular component and it has 'articles' input, then verify that it is part of this module.
2. If 'feed-grid' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message.
しかし、私は(それがこのプラグインなしで動作し、特に以来)私は正しく私の入力を宣言しています信じています。
import { Component, Input } from '@angular/core';
import { ArticleModel } from '../../models/article.model';
@Component({
selector: 'feed-grid',
styleUrls: ['./feed-grid.scss'],
template: require('./feed-grid.html')
})
export class FeedGrid {
@Input() articles: ArticleModel[] = [];
constructor() {}
}
私はこのUglifyプラグインで何か不足していて、それに入力を宣言していますか? @Input()の検証や入力コンポーネントの属性については、どこでも見つけることができます。これが役に立ったらrc5を使っています。それが必要と角度のチームは今のために自分のドキュメントに周りの仕事を提供するが、それは、これを追加し、すぐに修正しwebpack.configファイルにする必要があり、完全に期待しているように
おかげで、 ジョン
私は、HTMLLoaderを使用しますが、UglifyJSいませんでした。プラグイン設定https://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin –
にお返事に追加してください(mangle:falseを設定してください)。 –