- Architecting Angular Applications with Redux,RxJS,and NgRx
- Christoffer Noring
- 225字
- 2021-08-27 19:56:13
The component – a controller and a building block
In the context of MVC, the component is the V and C, the view and the controller. The component allows you to define either a separate template file or an inline template. The template is the view part.
The controller in this context is a component class file that handles user interactions and also fetches the necessary data for the template to display.
Components have come to be a central concept for a lot of frameworks that are popular today, such as React, Vue.js, and Polymer. A component can take inputs, which are either data or methods. It consists of a piece of code and an HTML template, which render interesting data, living on the component. A component in Angular consists of three major parts:
- A decorator function
- A class
- A template
A component consists of a controller class and a template. It can play two different roles in an Angular application: either it can be the responder to the route or it can serve as a building block. In the first case, Angular will instantiate it when a new route happens and respond with that component. In the latter case, the component is created directly by existing as a child component within another component.
We will explain next what we meant by the previous paragraph.
- 物聯(lián)網(wǎng)安全(原書第2版)
- 物聯(lián)網(wǎng)安全:理論、實(shí)踐與創(chuàng)新
- 智能網(wǎng)聯(lián)汽車V2X與智能網(wǎng)聯(lián)設(shè)施I2X
- 物聯(lián)網(wǎng)之魂:物聯(lián)網(wǎng)協(xié)議與物聯(lián)網(wǎng)操作系統(tǒng)
- NB-IoT物聯(lián)網(wǎng)技術(shù)解析與案例詳解
- 計(jì)算機(jī)網(wǎng)絡(luò)原理與應(yīng)用技術(shù)
- IPv6網(wǎng)絡(luò)切片:使能千行百業(yè)新體驗(yàn)
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)及應(yīng)用
- 5G時代的大數(shù)據(jù)技術(shù)架構(gòu)和關(guān)鍵技術(shù)詳解
- 移動物聯(lián)網(wǎng):商業(yè)模式+案例分析+應(yīng)用實(shí)戰(zhàn)
- 物聯(lián)網(wǎng)的機(jī)遇與利用
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)
- 物聯(lián)網(wǎng)M2M開發(fā)技術(shù):基于無線CPU-Q26XX
- RestKit for iOS
- 網(wǎng)絡(luò)信息安全工程技術(shù)與應(yīng)用分析