修正リスト
template/stylesの参照方法を変更
- 変更前
@Component({
selector: "hoge-page",
template: require("./hoge.component.html"),
styles: [ require("./about.css") ]
})
export class HogeComponent {
}
- 変更後
@Component({
selector: "hoge-page",
templateUrl: "./hoge.component.html",
styleUrls: ["./about.css"]
})
export class HogeComponent {
}
ngOnChangesの引数を定義する
- 変更前
export class HogeComponent {
ngOnChanges() {
}
}
- 変更後
export class HogeComponent {
ngOnChanges(changes: SimpleChanges) {
}
}
htmlで参照する変数はprivateを外す
- 変更前
export class HogeComponent {
private hoo: string;
}
- 変更後
export class HogeComponent {
hoo: string;
}
constructorで定義したprivate変数をhtmlで参照するときは、publicに変更する
- 変更前
export class HogeComponent {
constructor(private model: HogeModel){};
}
- 変更後
export class HogeComponent {
constructor(public model: HogeModel){};
}
build コマンドの変更
- 変更前
./node_modules/.bin/ng build --prod --aot
- 変更後
node --max_old_space_size=2048 ./node_modules/.bin/ng build --prod --aot