随笔分类 - Angular
摘要:Just like in *ngFor, you're able to pass in data into your own structural directives. This is done by declaring the variable using a let statement the
阅读全文
摘要:Structural directives enable you to use an element as a template for creating additional elements. Creating structural directives requires a knowledge
阅读全文
摘要:You can change behaviors of element and @Component properties based on services using @HostBinding in @Directives. This allows you to build @Directive
阅读全文
摘要:A @Directive is used to add behavior to elements and components in your application. This makes @Directives ideal for behaviors such as "tracking" whi
阅读全文
摘要:A @Directive can also listen to events on their host element using @HostListener. This allows you to add behaviors that react to user input and update
阅读全文
摘要:The @Input decorator allows you to pass values into your @Directive so that you can change the value of the Directive each time that it is used. Using
阅读全文
摘要:Angular 2 Directives allow you manipulate elements by adding custom behaviors through attributes. This lesson covers how to create a Directive and att
阅读全文
摘要:Recommend to use angular-cli to generate component and service, so we can get testing templates. Component with injected service: Service:
阅读全文
摘要:Found the way to handle Auxiliary router for lazy loading moudle and erge load module are different. In Erge loading, it is recommended to create a sh
阅读全文
摘要:The idea is when we tape the arrow keys on the keyboard, we want the ball move accodingly. Here, 'curr' is the function return from 'mapTo', the 'acc'
阅读全文
摘要:getActivatedRoutePath(r: ActivatedRoute) { return r.url .subscribe(p => this.curtPath = p[0].path)}
阅读全文
摘要:'canLoad' guard can decide whether a lazy load module can be loaded or not. app.routers.ts: So if user not login, app won't load home module.
阅读全文
摘要:In this lesson we are going to learn how to build a custom Node process for batch processing of Firebase data using the Firebase queue library. From U
阅读全文
摘要:Article
阅读全文
摘要:import {AuthProviders, FirebaseAuthState, FirebaseAuth, AuthMethods} from "angularfire2";import {Injectable} from "@angular/core";import {Subject, BehaviorSubject} from "rxjs";import {AuthInfo} from ...
阅读全文
摘要:After successfully login, we want something help to check whether user has already login or not. And we will use Observable to do that. Create AuthInf
阅读全文
摘要:First, you need to enable the email auth in Firebase console. Then implement the auth service: Because login method return Promise, we need to convert
阅读全文
摘要:We can build a template, use this template and pass in different context to make it reuseable:
阅读全文
摘要:Angular 2 templates have a special let syntax that allows you to define and pass a context when they’re being generated. We have template: And we defi
阅读全文
摘要:From Article: RESOLVING ROUTE DATA IN ANGULAR 2 Github If you know Anuglar UI router, you must know resolve function in ui router, which you can load
阅读全文