随笔分类 - Angular
摘要:import {Injectable} from '@angular/core'; import {Skill} from '../models/skills'; import {AuthService} from '../../auth/services/auth.service'; import 'rxjs/add/operator/do'; import 'rxjs/add/operat...
阅读全文
摘要:Also check: directive for form validation User input validation is a core part of creating proper HTML forms. Form validators not only help you to get
阅读全文
摘要:Install: Basic example: Advanced example: Component:
阅读全文
摘要:Always treat Router as the source of truth When we use Ngrx, we can see that we will use a "StoreRouterConnectingModule" from the example app. What it
阅读全文
摘要:Register a account on https://console.dialogflow.com/api-client/ "Creat a intent" -- you can custom your message here. "Small Talks" -- the default me
阅读全文
摘要:The upload class will be used in the service layer. Notice it has a constructor for file attribute, which has a type of File. This will allows us to i
阅读全文
摘要:User input validation is a core part of creating proper HTML forms. Form validators not only help you to get better quality data but they also guide t
阅读全文
摘要:Updated to AngularFire2 v5.0. One important change is that you need to call .snapshotChanges() or .valueChanges() to get data as Observable back. The
阅读全文
摘要:The way to test router componet needs a little bit setup, first we need to create a "router-stubs.ts". This file is a helper file. The component we wa
阅读全文
摘要:Both what "TestBed.get" & "injector" trying to do is get service for the test component. But there is some diffenece which determined when use which.
阅读全文
摘要:When you testing Component rendering, you often needs to call: For example: You can also set auto change detection: Add to providers: Tests wit auto c
阅读全文
摘要:When using Ngrx, we need to know how to test the component which has Router injected. Component: One thing we can test just for component wihtout temp
阅读全文
摘要:If you want to style host component. You can use ':host-context'. In the host component, we have 'styled-component' class, we want to apply some css t
阅读全文
摘要:Once user sign up, we store the user data inside cookie in the broswer and also keep a memory copy in the server. If next time, user refresh the page,
阅读全文
摘要:For the whole signup process. we need to Hash the password to create a password digest Store the user's info and password digest into db Create a rand
阅读全文
摘要:New use case that is supported by the HTTP client is Progress events. To receive these events, we create our HTTP request manually in the following wa
阅读全文
摘要:With the shareReplay operator in place, we would no longer fall into the situation where we have accidental multiple HTTP requests. And this covers th
阅读全文
摘要:From Angular V4, there is new HttpClient module, in which HttpHeaders is an immutable api.
阅读全文
摘要:It is possible to use HttpParams to set http params. For example we have this url to make: So there are two params: 1. orderby 2. limitToFirst Using H
阅读全文
摘要:Create a directive to check no special characters allowed:
阅读全文