- Architecting Angular Applications with Redux,RxJS,and NgRx
- Christoffer Noring
- 98字
- 2021-08-27 19:56:13
The model
The model in Angular is a plain class, as we are using TypeScript. It can look like the following code:
// mvc/MvcExample/src/app/product.model.ts
export class Product {
constructor(
private id: number,
private title: string,
private description: string,
private created: Date
) {}
method() {}
anotherMethod() {}
}
It is a plain TypeScript file, or rather an ES2015 module, not to be confused with an Angular module. We will discuss in the next main section what an Angular module is, in terms of setup and how it is consumed. For now, remember the model is a simple thing.
推薦閱讀
- TCP/IP入門經(jīng)典(第5版)
- 萬物互聯(lián):蜂窩物聯(lián)網(wǎng)組網(wǎng)技術(shù)詳解
- Go Web Scraping Quick Start Guide
- React:Cross-Platform Application Development with React Native
- Mastering TypeScript 3
- 物聯(lián)網(wǎng)之霧:基于霧計(jì)算的智能硬件快速反應(yīng)與安全控制
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實(shí)戰(zhàn)
- OMNeT++與網(wǎng)絡(luò)仿真
- Working with Legacy Systems
- 網(wǎng)絡(luò)環(huán)境中基于用戶視角的信息質(zhì)量評價(jià)研究
- 互聯(lián)網(wǎng)+思維與創(chuàng)新:通往未來的+號
- 物聯(lián)網(wǎng)工程概論
- 網(wǎng)絡(luò)空間全球治理觀察
- 物聯(lián)網(wǎng)M2M開發(fā)技術(shù):基于無線CPU-Q26XX
- 區(qū)塊鏈社區(qū)運(yùn)營手冊