随笔分类 -  Angular

摘要:Pipes need a new reference or else they will not update their output. In this lesson you will use the Array ...spread operator to create new Array to 阅读全文
posted @ 2016-03-21 20:35 Zhentiw 阅读(166) 评论(0) 推荐(0)
摘要:Pipes allow you to change data inside of templates without having to worry about changing it in the Controller. Creating a custom Pipe is as simple as 阅读全文
posted @ 2016-03-21 20:25 Zhentiw 阅读(194) 评论(0) 推荐(0)
摘要:Style and View Encapsulation is best understood by seeing how each option (Emulated, Native, and None) compare to each other. 阅读全文
posted @ 2016-03-21 19:31 Zhentiw 阅读(273) 评论(0) 推荐(0)
摘要:Many Components require different styles based on a set of conditions. Angular 2 helps you style your Components by allows you to define Styles inline 阅读全文
posted @ 2016-03-21 17:26 Zhentiw 阅读(177) 评论(0) 推荐(0)
摘要:@Input allows you to pass data into your controller and templates through html and defining custom properties. This allows you to easily reuse compone 阅读全文
posted @ 2016-03-21 17:21 Zhentiw 阅读(291) 评论(0) 推荐(0)
摘要:This lesson covers using the [input] syntax to change an element property such as “hidden” or “content-editable”. Using properties eliminates the need 阅读全文
posted @ 2016-03-21 16:34 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要:Instead of each time create a string add into the todos, we create a TodoModel. 阅读全文
posted @ 2016-03-21 02:13 Zhentiw 阅读(136) 评论(0) 推荐(0)
摘要:Two-way binding still exists in Angular 2 and ng-model makes it simple. The syntax is a combination of the [input] and (output) syntax to represent th 阅读全文
posted @ 2016-03-21 01:54 Zhentiw 阅读(194) 评论(0) 推荐(0)
摘要:This lesson covers Angular 2’s version of looping through data in your templates: ng-for. It’s conceptually the same as Angular 1’s ng-repeat, but you 阅读全文
posted @ 2016-03-21 01:34 Zhentiw 阅读(158) 评论(0) 推荐(0)
摘要:TypeScript is used heavily as we build up our application, but TypeScript isn’t required. If you want to Inject a Service without using TypeScript, yo 阅读全文
posted @ 2016-03-20 22:26 Zhentiw 阅读(309) 评论(0) 推荐(0)
摘要:Using Services in Angular 2 is very simple. This lesson covers how to create a simple class as a Service then set it up so that you can use it across 阅读全文
posted @ 2016-03-20 03:39 Zhentiw 阅读(162) 评论(0) 推荐(0)
摘要:This lesson talks about the benefits of using the parens-based (click) syntax so that Angular 2 can handle any custom event. Then the video explains h 阅读全文
posted @ 2016-03-20 03:18 Zhentiw 阅读(229) 评论(0) 推荐(0)
摘要:This lesson shows you how set listen for click events using the (click) syntax. It also covers getting values off of an input using the #ref syntax th 阅读全文
posted @ 2016-03-18 21:06 Zhentiw
摘要: 阅读全文
posted @ 2016-03-18 16:55 Zhentiw 阅读(178) 评论(0) 推荐(0)
摘要:Some tips for import libaray by using webstorm: // Alt + Enter --> Auto Import // Ctrl + Alt + o --> Optimize import //Ctrl + space --> Auto completio 阅读全文
posted @ 2016-03-18 16:35 Zhentiw 阅读(235) 评论(0) 推荐(0)
摘要:When you create a Form in Angular 2, you can easily get all the values from the Form using ControlGroup and Controls.Bind [ng-form-model] to the form ... 阅读全文
posted @ 2015-11-23 01:29 Zhentiw
摘要:You can watch for form / control changes by using .valueChanges.observe({...}): this.sku.valueChanges.observer({ next: (value)=>{ ... 阅读全文
posted @ 2015-11-09 01:55 Zhentiw
摘要:Create a custom validtor which only accepts the string start with '123'; function skuValidator(control){ if(!control.value.match(/^123/)){ ... 阅读全文
posted @ 2015-11-09 01:48 Zhentiw
摘要:In last post, we need to create an instanse variable:sku: AbstructControl;We can get rid of this by getting the exported form from NgFormControl, what... 阅读全文
posted @ 2015-11-09 01:37 Zhentiw
摘要:Define a filed should has validation: export class DemoFormSku { myForm: ControlGroup; sku: AbstractControl; constructor(fb:FormBuilder) { this.myForm 阅读全文
posted @ 2015-11-06 04:04 Zhentiw