随笔分类 - Angular
摘要:When want to display different component based on some conditions:
阅读全文
摘要:Using ngClass for conditional styling, here is the usage from the docs: It is also recommended when the conditional logics is complicated, we can usin
阅读全文
摘要:Using Angular CLI v6, we are able to create library or small application inside a Angular CLI generated application. If for example, the lib logger-li
阅读全文
摘要:A component author has no way of knowing which state changes a consumer will want to override, but state reducers handle this problem by allowing the
阅读全文
摘要:If we’re going to make our toggle accessible, we’ll need to apply certain aria attributes to the control that does the toggling. Instead of making the
阅读全文
摘要:Allow the base toggle to be a tag (<toggle>) or attribute (<div toggle>). The <toggle> component has become less opinionated about the view, but has n
阅读全文
摘要:Allow more than one child component of the same type. Allow child components to be placed within the views of other custom components. In previous pos
阅读全文
摘要:Allow the user to control the view of the toggle component. Break the toggle component up into multiple composable components that can be rearranged b
阅读全文
摘要:There is now a new, recommended, way to register a provider, directly inside the @Injectable() decorator, using the new providedIn attribute. When you
阅读全文
摘要:Router Scroll Position Restoration: remember and restore scroll position as the user navigates around an application. ShadowDOM v1 View Encapsulation:
阅读全文
摘要:Origianl article Protal from Angular CDK, is a way to create dynammic component. Consider an example of Page toolbar. This toolbar should show differe
阅读全文
摘要:The Angular <ng-container> is a grouping element that doesn't interfere with styles or layout because Angular doesn't put it in the DOM. When we using
阅读全文
摘要:When we use NGRX, we need to create some bolipates. Now with Angulalr6, we can use CLI to generate those code for us. Install: @ngrx/schematics: Scaff
阅读全文
摘要:Prevent Partail Page display: By using Resolver: Display Loading spinner when switching page: Enable route debugging: Talk
阅读全文
摘要:For example you make a function to get rating; Then using it in html: These code actually casues the preformance issues, because everything Angualr's
阅读全文
摘要:1. Installl latest @angular/cli: The version I used is:6.0.0-rc.10 2. Create a new application: 3. Install material and cdk packages: Here need to add
阅读全文
摘要:Went though tow youtube videos about NGXS https://angularfirebase.com/lessons/ngxs-quick-start-angular-state-management/ https://www.youtube.com/watch
阅读全文
摘要:In this post, we are going to see how to solve one design pattern challenge. The challenge is what we a simplest way to find out the children elements
阅读全文
摘要:In some cases, you want to get fresh data instead of cache data to the screen, such as stock applications. Only fallback to cache data if cannot get r
阅读全文
摘要:If you want to cache API response by using angular service-worker, you can do it in: src/ngsw-config.json:
阅读全文