0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

angular2 AoTコンパイルが通るまでの修正リスト

0
Last updated at Posted at 2017-10-31

修正リスト

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
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?