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

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.
主站蜘蛛池模板: 建宁县| 白河县| 酒泉市| 卓尼县| 霞浦县| 绥滨县| 平利县| 合肥市| 威远县| 中超| 常熟市| 兴义市| 蓝山县| 蓬安县| 琼结县| 临安市| 嵩明县| 精河县| 巍山| 丰顺县| 札达县| 葵青区| 晋城| 读书| 江川县| 康平县| 德江县| 紫金县| 托克逊县| 万全县| 永康市| 涞源县| 大渡口区| 登封市| 常州市| 马龙县| 绥滨县| 宜宾县| 迁西县| 屏山县| 平乡县|