随笔分类 -  Angular

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页
摘要: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... 阅读全文
posted @ 2017-11-02 03:04 Zhentiw 阅读(296) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-11-01 19:49 Zhentiw 阅读(255) 评论(0) 推荐(0)
摘要:Install: Basic example: Advanced example: Component: 阅读全文
posted @ 2017-10-31 19:31 Zhentiw 阅读(468) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-30 21:43 Zhentiw 阅读(598) 评论(0) 推荐(0)
摘要:Register a account on https://console.dialogflow.com/api-client/ "Creat a intent" -- you can custom your message here. "Small Talks" -- the default me 阅读全文
posted @ 2017-10-24 03:38 Zhentiw 阅读(880) 评论(1) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-22 01:57 Zhentiw 阅读(790) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-22 00:12 Zhentiw 阅读(234) 评论(0) 推荐(0)
摘要:Updated to AngularFire2 v5.0. One important change is that you need to call .snapshotChanges() or .valueChanges() to get data as Observable back. The 阅读全文
posted @ 2017-10-18 22:53 Zhentiw 阅读(377) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-12 15:48 Zhentiw 阅读(940) 评论(0) 推荐(0)
摘要: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. 阅读全文
posted @ 2017-10-10 19:21 Zhentiw 阅读(1688) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-10 16:51 Zhentiw 阅读(273) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-10-10 15:54 Zhentiw 阅读(572) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-09-27 00:58 Zhentiw 阅读(1982) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2017-09-04 21:24 Zhentiw 阅读(399) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-29 16:46 Zhentiw 阅读(2847) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-23 16:14 Zhentiw 阅读(562) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-23 15:52 Zhentiw 阅读(395) 评论(0) 推荐(0)
摘要:From Angular V4, there is new HttpClient module, in which HttpHeaders is an immutable api. 阅读全文
posted @ 2017-08-23 15:47 Zhentiw 阅读(430) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-08-23 15:36 Zhentiw 阅读(996) 评论(0) 推荐(0)
摘要:Create a directive to check no special characters allowed: 阅读全文
posted @ 2017-08-21 01:53 Zhentiw 阅读(338) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页