随笔分类 -  Angular

摘要:There are two main functions we’ll use on FormBuilder:•control - creates a new Control• group - creates a new ControlGroupimport {Component, bootstrap... 阅读全文
posted @ 2015-11-06 02:55 Zhentiw
摘要:Control:Controls encapsulate the field's value, a states such as if it is valid, dirty or has errors.var nameControl = new Control("Nate");var name = ... 阅读全文
posted @ 2015-11-06 02:40 Zhentiw
摘要:If you want to print someting like {{content}} on the html, using ng-non-bindable directive: 阅读全文
posted @ 2015-11-06 02:10 Zhentiw
摘要:Besides @Input(), we can also use properties on the @Component, to pass the data.import {Component, View, NgFor, Input} from 'angular2/angular2';@Comp... 阅读全文
posted @ 2015-11-02 02:47 Zhentiw
摘要:Showing how to set up a Pipe that takes multiple updating inputs for multiple Component sources.import {Component, View, NgFor, FORM_DIRECTIVES} from ... 阅读全文
posted @ 2015-11-01 17:33 Zhentiw
摘要:This lesson shows you how to create a component and pass its properties as it updates into a Pipe to make a simple searchable list.import {Pipe} from ... 阅读全文
posted @ 2015-11-01 04:33 Zhentiw
摘要:Explaining how Pipes only change by default when your Pipe input parameters change and not when your data changes. It also shows you how to make an “u... 阅读全文
posted @ 2015-11-01 03:41 Zhentiw
摘要:Showing you how you can expose properties on your Controller to access them using #refs inside of your template.// letterSelect.tsimport {Component, V... 阅读全文
posted @ 2015-11-01 03:33 Zhentiw
摘要:You can use Select and Option elements in combination with ng-for and ng-model to create mini-forms that change your data as you make a selection./** ... 阅读全文
posted @ 2015-11-01 03:21 Zhentiw
摘要: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 @ 2015-10-28 03:47 Zhentiw
摘要:Style and View Encapsulation is best understood by seeing how each option (Emulated, Native, and None) compare to each other. Angular 2 QuickStart ... 阅读全文
posted @ 2015-10-28 03:30 Zhentiw
摘要:import {Input, Component, View, NgClass} from "angular2/angular2";@Component({ selector: 'todo-item-render'})@View({ directives: [NgClass], s... 阅读全文
posted @ 2015-10-28 03:18 Zhentiw
摘要:@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 @ 2015-10-26 04:34 Zhentiw
摘要:This lesson covers using the [input] syntax to change an element property such as “hidden” or “content-editable”. Using properties eliminates the need... 阅读全文
posted @ 2015-10-26 04:15 Zhentiw
摘要:Instead of add todo as a string, we create a data model:export class TodoModel{ constructor( public title: string = "" ){}}export class T... 阅读全文
posted @ 2015-10-26 04:07 Zhentiw
摘要: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 @ 2015-10-26 02:38 Zhentiw
摘要:It’s conceptually the same as Angular 1’s ng-repeat, but you’ll find the syntax quite different as it aligns with #refs in Angular 2 and JavaScript “f... 阅读全文
posted @ 2015-10-26 02:26 Zhentiw
摘要: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 @ 2015-10-23 15:28 Zhentiw
摘要:When creating a service, need to inject the sercive into the bootstrap():import {bootstrap, Component, View} from "angular2/angular2";import {TodoInpu... 阅读全文
posted @ 2015-10-23 15:25 Zhentiw
摘要:Let's say you want to write a simple data bing app. when you type in a text box, somewhere in the application will show the result.In Angular 1, you c... 阅读全文
posted @ 2015-09-16 03:47 Zhentiw