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

Components from an architectural standpoint

You are encouraged to create a lot of components in your Angular application. With the former section's example of creating a todo list application it was tempting to create an application that just consisted of one component, the AppComponent. This would have meant that one component would have been responsible for a ton of things, such as displaying todo items, saving said items, removing them and so on. Components are meant to be used to solve one thing well. That's why we created a TodoItemComponent which only job in life was to display a todo item. Same thing goes for the TodoListComponent. It should only care about displaying a list, nothing else. The more you split down your applications into small and focused areas the better. 

主站蜘蛛池模板: 天峨县| 班玛县| 万安县| 岑溪市| 开封县| 文安县| 银川市| 桂东县| 高台县| 全州县| 镇远县| 鸡泽县| 凭祥市| 岐山县| 濉溪县| 武宣县| 麟游县| 健康| 方城县| 古浪县| 海宁市| 湖北省| 万安县| 中阳县| 潍坊市| 若羌县| 嘉定区| 芜湖市| 松原市| 太和县| 夏津县| 乌兰浩特市| 曲靖市| 南木林县| 巴林右旗| 丰都县| 靖边县| 平罗县| 攀枝花市| 水城县| 鱼台县|