So when you using input binding in Angular, it will always check for update. If you want to improve youre preformence a little bit, you can use @Attribute decorator comes with Angular latest v6. From code: export type ButtonType = 'primary' | 'second…
When we pass value to a component, normally we use @Input. <my-comp [courses]="(courses$ | async) as courses" ></my-comp> @Component({...}) export class MyComp implements OnInit { @Input() courses; ... } Angular will check whether an…
ngrx/store is a library that simplifies common RxJS patterns for managing state and gives you an easy api to use it within your Angular 2 application. This lesson shows how to convert a common startWith and scan stream into an ngrx Store and reducer.…
Web Component 在介绍Angular Component之前,我们先简单了解下W3C Web Components 定义 W3C为统一组件化标准方式,提出Web Component的标准. 每个组件包含自己的html.css.js代码. Web Component标准包括以下四个重要的概念: Custom Elements(自定义标签):可以创建自定义 HTML 标记和元素: HTML Templates(HTML模版):使用 概括来说就是,可以创建自定义标签来引入组件是前端组件化的…
Extracting away the implementation details of ngrx from your components using the facade pattern creates some interesting possibilities in terms of iteratively migrating an application to ngrx. By decoupling your components from ngrx completely, this…