-1

I was watching The Angular Compiler 4.0 - TOBIAS BOSCH and suddenly at 1:30 of the video it was said that 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. now I am super confused what actually is happening under the hood? Whether (.ts) is transpiled to js first by typescript compiler and then angular compiler comes into the play or angular compiler do the job and typescript compiler comes into the play? I went through this What does the angular compiler “compile”? but apparently my doubt is not clear yet? Can anyone help me out on this?

Vikas
  • 11,859
  • 7
  • 45
  • 69
  • Before 4.4.0 AOT compiler emitted typescript files. Now angular moved to transform based compiler and emits js factories. – yurzui Jan 21 '18 at 20:40

1 Answers1

0

Whether (.ts) is transpiled to js first by typescript compiler and then angular compiler comes into the play or angular compiler do the job and typescript compiler comes into the play

  • With AOT compiler you have angular html -> TS (to ensure types are correct) - > JS
  • With JIT you have angular html -> embedded in js and parsed / executed on the fly
basarat
  • 261,912
  • 58
  • 460
  • 511
  • @ basarat Could you suggest me some links where I would get a complete picture of what is happening under the hood? – Vikas Jan 22 '18 at 16:15
  • Does it mean in JIT compilation, tsc doesn't play any role? – Vikas Jan 22 '18 at 16:19
  • [ahead-of-time-compilation-angular-offline-precompilation](http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/) this link cleared all my doubts. – Vikas Jan 22 '18 at 16:37