官术网_书友最值得收藏!

Everything is a component

As an early adopter of Angular and while talking to other people about it, I got frequently asked what the biggest difference is to the first version. My answer to this question was always the same. Everything is a component:

Within the Angular architecture, a component is a directive with an additional view

For me, this paradigm shift was the most relevant change that both simplified and enriched the framework. Of course, there are a lot of other changes with Angular. However, as an advocate of component-based user interfaces, I've found that this change is the most interesting one. Of course, this change also came with a lot of architectural changes.

Angular supports the idea of looking at the user interface holistically and fosters composition with components. However, the biggest difference to its first version is that now, your pages are no longer global views; they are simply components that are assembled from other components. If you've been following this chapter, you'll notice that this is exactly what a holistic approach to user interfaces demands. No more pages, but systems of components.

Angular still uses the concept of directives, although directives are now really what the name suggests. They are orders for the browser to attach a given behavior to an element. Components are a special kind of directive that come with a view.
主站蜘蛛池模板: 富川| 吴川市| 迁安市| 嘉善县| 佛山市| 武平县| 平乡县| 禄丰县| 桓台县| 松原市| 桃园市| 公安县| 昌平区| 泸溪县| 靖江市| 永宁县| 临朐县| 固阳县| 东明县| 张北县| 宁津县| 屏东市| 河南省| 庄浪县| 鄂托克前旗| 灵山县| 开远市| 玉门市| 伊通| 穆棱市| 安化县| 平江县| 乐昌市| 富顺县| 库尔勒市| 故城县| 吴桥县| 宣武区| 澎湖县| 肃南| 阳信县|