【问题标题】:Does typescript transpile the Transformed code generated by Angular Compilertypescript 是否会转译 Angular Compiler 生成的转换后的代码
【发布时间】:2018-06-30 11:24:14
【问题描述】:

我正在观看The Angular Compiler 4.0 - TOBIAS BOSCH,突然在视频的 1:30 时有人说AST is transformed into typescript code if we use AOT compilation or javascript code if we use JIT compilation.Compilation process a snapshot of the video。现在我非常困惑引擎盖下到底发生了什么? (.ts) 是否首先由 typescript 编译器转译为 js,然后 angular 编译器发挥作用,还是 angular 编译器完成这项工作,然后 typescript 编译器发挥作用?我经历了这个What does the angular compiler “compile”? ,但显然我的疑问还不清楚?谁能帮我解决这个问题?

【问题讨论】:

  • 4.4.0 之前的 AOT 编译器发出打字稿文件。现在 Angular 转移到基于转换的编译器并发出 js 工厂。

标签: angular typescript angular-compiler


【解决方案1】:

(.ts) 是先由 typescript 编译器转译为 js,然后 angular 编译器开始发挥作用,还是 angular 编译器完成这项工作,然后 typescript 编译器开始发挥作用

  • 使用 AOT 编译器,您有 angular html -> TS (to ensure types are correct) - > JS
  • 使用 JIT,您有 angular html -> embedded in js and parsed / executed on the fly

【讨论】:

猜你喜欢
  • 2021-12-19
  • 2014-04-21
  • 2016-07-24
  • 2021-06-28
  • 1970-01-01
  • 1970-01-01
  • 2012-09-22
  • 1970-01-01
相关资源
最近更新 更多