随笔分类 - Angular
摘要:When migrating AngularJS (v1.x) applications to Angular you have different options. Using Angular Elements is one of them. In this lesson we learn how
阅读全文
摘要:In a real world scenario we obviously need to be able to communicate with an Angular Element embedded into our static HTML site. In this lesson we wil
阅读全文
摘要:We can treat Angular Element as each standlone lib and compile each Angular element spreatly. Tool we are using to compile Angular element is 'ngx-bui
阅读全文
摘要:Make sure install the latest Angular v6 with Angular CLI. Checkout ght Github for the code. 1. Create a new application: 2. Install @angular/elements
阅读全文
摘要:For example we have those code: ngSwith code, and we want to convert to i18n as well, we can use 'select' keyword:
阅读全文
摘要:// Component: this.coursesTotal = this.course,length {coursesTotal, plural, =0 {No course in available.} =1 {One course is available.} other {A total of {{coursesTotal}} courses are availab...
阅读全文
摘要:To add translation to the application: 'i18n' is for Angular CLI to extract all the string which need to be translated. Run: It will generate messages
阅读全文
[Angular] Extract Implementation Details of ngrx from an Angular Application with the Facade Pattern
摘要:Extracting away the implementation details of ngrx from your components using the facade pattern creates some interesting possibilities in terms of it
阅读全文
摘要:Communicating with a remote server via HTTP presents an extra level of complexity as there is an increased chance of race conditions and the need for
阅读全文
摘要:AfterContentChecked & AfterViewChecked are called after 'OnChanges' lifecycle. And each time 'ngOnChanges' triggered, ngAfterContentChecked and ngAfte
阅读全文
摘要:1. ngOnChanges is called before ngOnInit but after constructor() 2. ngOnChanges is called because of @Input() obj, obj's reference changes. If you mut
阅读全文
摘要:We explore our first stateful transaction, by devising a means to echo our state value into the resultant for independent modification. With our state
阅读全文
摘要:Each component has its own ChangeDetectorRef, and we can inject ChangeDetectorRef into constructor: For example if you have a huge list can be updated
阅读全文
摘要:When we pass value to a component, normally we use @Input. Angular will check whether any update on @Input on each event fires in order to keep DOM up
阅读全文
摘要:Very differently to AngularJS (v1.x), Angular now has a hierarchical dependency injector. That allows to specify service definitions as well as the se
阅读全文
摘要:When we create a Service, Angluar CLI will helps us to add: It only create a instance in root dependency tree. If there is no reference to use this pr
阅读全文
摘要:For example we have a component: And a driective: We want to get the driective instant inside the component code, we can use @ViewChild: Then we can a
阅读全文
摘要:Source: https://blog.angularindepth.com/debug-angular-apps-in-production-without-revealing-source-maps-ab4a235edd85 Build application with source map:
阅读全文
摘要:It is not clear in the Docs about {read: xx} option for @ViewChild. Based on the Source code, @ViewChild as view as Component, ElementRef, TemplateRef
阅读全文
摘要:The usecase is very simple: '=0' & '=1' are exactly match, 'other' are category match for the rest of numbers, you have to use 'other', this is the ru
阅读全文