- Architecting Angular Applications with Redux,RxJS,and NgRx
- Christoffer Noring
- 133字
- 2021-08-27 19:56:14
An Angular example
We have been using ES2015 imports extensively throughout this chapter already, but let's emphasize when that was. As mentioned, all constructs used ES2015 modules, models, services, components, and modules. For the module, this looked like this:
import { NgModule } from '@angular/core';
@NgModule({
declarations: [],
imports: [],
exports: [],
providers: []
})
export class FeatureModule {}
Here, we see that we import the functionality we need and we end up exporting this class, thereby making it available for other constructs to consume. It's the same thing with modules, like so:
import { Component } from '@angular/core';
@Component({
selector: 'example'
})
export class ExampleComponent {}
The pipe, directive, and filter all follow the same pattern of importing what they need and exporting themselves to be included as part of an NgModule.
推薦閱讀
- 連接未來:從古登堡到谷歌的網(wǎng)絡(luò)革命
- CorelDRAW X6 中文版圖形設(shè)計(jì)實(shí)戰(zhàn)從入門到精通
- 6G潛在關(guān)鍵技術(shù)(下冊(cè))
- 物聯(lián)網(wǎng)安全技術(shù)
- Microservice Patterns and Best Practices
- 新手易學(xué):新手學(xué)淘寶開店
- Scala Design Patterns.
- AWS Lambda Quick Start Guide
- 計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)
- 5G非正交多址接入技術(shù):理論、算法與實(shí)現(xiàn)
- 華為HCIA-Datacom認(rèn)證指南
- Getting Started with tmux
- 物聯(lián)網(wǎng)與智慧農(nóng)業(yè)
- Hands-On Reactive Programming in Spring 5
- 物聯(lián)網(wǎng)商業(yè)設(shè)計(jì)與案例