Angular内部对template的处理学习笔记

简介: Angular内部对template的处理学习笔记

https://blog.angular-university.io/angular-2-what-is-unidirectional-data-flow-development-mode/


How does Angular use the template to display the data of the screen, what is going on under the hood?


Clearly Angular is not handling the template simply as a string.


Angular绝不仅仅是将template当成一个string来处理。


It’s actually quite simple: Angular is taking the data and it’s applying it a function. The output of that function is the DOM data structure that corresponds to this HTML template.


Angular执行template function,该function的输出是DOM数据结构,同HTML template一致。


Angular is not generating HTML as a string, its generating DOM data structures directly.


For example, in our case Angular will generate the DOM data structure directly from the data via a component renderer.


If the application would be a native mobile application or a server-side application then the output of the renderer would be something else. But in this case, the output of the component renderer is the DOM tree that represents the component view.

相关文章
|
5月前
|
Web App开发 前端开发 JavaScript
关于 Angular template 文件在 Chrome 开发者工具调试器里的断点问题
关于 Angular template 文件在 Chrome 开发者工具调试器里的断点问题
|
存储 缓存 JavaScript
Angular Universal 学习笔记
Angular Universal 学习笔记
|
前端开发 JavaScript API
Angular Change Detection 的学习笔记
Angular Change Detection 的学习笔记
|
存储 缓存 JavaScript
Angular Universal 学习笔记
Angular Universal 学习笔记
131 0
Angular Universal 学习笔记
|
JavaScript
Angular Form (响应式Form) 学习笔记
Angular Form (响应式Form) 学习笔记
184 0
Angular Form (响应式Form) 学习笔记
|
JSON API 数据格式
Angular CLI builder 学习笔记
Angular CLI builder 学习笔记
122 0
Angular CLI builder 学习笔记
|
JavaScript 测试技术 API
Angular library 学习笔记
Angular library 学习笔记
205 0
Angular library 学习笔记
|
设计模式 JavaScript 前端开发
Angular Lazy load(延迟加载,惰性加载) 机制和 feature module 的学习笔记
Angular Lazy load(延迟加载,惰性加载) 机制和 feature module 的学习笔记
344 0
Angular Lazy load(延迟加载,惰性加载) 机制和 feature module 的学习笔记
|
JavaScript 开发者
Angular 依赖注入学习笔记之工厂函数的用法
Angular 依赖注入学习笔记之工厂函数的用法
Angular 依赖注入学习笔记之工厂函数的用法
下一篇
无影云桌面