随笔分类 - Angular
摘要:First thing first, let's define a action to update entity: The 'Update' interface has props: 'id, changes'. Component usage: Reducer: Effect:
阅读全文
摘要:ng-container is using for grouping elments together, a bit similar to div. If you want to group some elements together, but don't want to break the DO
阅读全文
摘要:1. First step is creating action creator Action name should be clear which page, which functionality, what is the action name "[Load Courses Effect] A
阅读全文
摘要:app.component.ts:
阅读全文
摘要:We have a reoslver, which everytime we want visit '/courses' route, it will be triggered, then api will be called, data will be loaded. So how to prev
阅读全文
摘要:'sortCompoarer' is used with adapter when you want to sort the entites based on one prop, 'ids' will be also sorted accordingly to the new entities.
阅读全文
摘要:Turn on runtime check: Docs
阅读全文
摘要:Make sure you have the@ngrx packages installed: To enable time travel debugging, you need to import: app.module.ts Enable add reducer for router: redu
阅读全文
摘要:Sometimes we might have some expensive function to calcuate state directly from template: The ´calculate´ function is a pure function, we can use memo
阅读全文
摘要:Measuring is extremely important, without numbers we don’t know about potential problems and we don’t have a base we can improve upon. Performance Bud
阅读全文
摘要:In a previous lesson we learned about implementing a custom preloading strategy. That gives you a lot of control over which route to preload and which
阅读全文
摘要:Preloading all modules is quite an extreme approach and might not always be desirable. For instance, you don't want to preload lazy routes a user migh
阅读全文
摘要:@NgModule({ declarations: [AppComponent, HomeComponent], imports: [ BrowserModule, MatSidenavModule, BrowserAnimationsModule, RouterModule.forRoot( [ { path: '', component: HomeComponent }, { path: 'n
阅读全文
摘要:We can easily code split and lazy load a route in Angular. However when the user then clicks that lazy loaded route, it make some time to actually fet
阅读全文
摘要:Ever had the need for multiple "app themes", or even to completely dynamically load CSS based on which customer logs into your application? You could
阅读全文
摘要:Proxy configuration: When we have already fews applications running in the workspace, and we want to add 'api' layer for one applicatrion only, we can
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:This post is based on the NG-CONF talk, check the talk by yourself. 1. Dynamiclly add Angular Element into your application: Once you have angular ele
阅读全文
摘要:Based on the talk from NG-CONF. Check it out by yourself, here is just my own take away :) Differential loading: The basic idea is that, Angular will
阅读全文