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

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.
主站蜘蛛池模板: 错那县| 长宁县| 陈巴尔虎旗| 浙江省| 乌拉特后旗| 惠来县| 安远县| 博野县| 思茅市| 攀枝花市| 汨罗市| 阿克苏市| 化州市| 沿河| 江陵县| 麻栗坡县| 比如县| 杭州市| 茌平县| 榆林市| 山西省| 襄城县| 南岸区| 东源县| 河曲县| 公主岭市| 汝阳县| 兰考县| 高安市| 娄底市| 昭平县| 义马市| 平山县| 华池县| 喜德县| 沐川县| 巫溪县| 土默特左旗| 庐江县| 卢龙县| 会昌县|