随笔分类 -  Angular

摘要:Observable.merge allows you take two different source streams and use either one of them to make changes to the same state of your data. This lesson s 阅读全文
posted @ 2016-04-26 03:32 Zhentiw 阅读(178) 评论(0) 推荐(0)
摘要:While Angular 2 usually uses event handlers to manage events and RxJS typically uses Observable.fromEvent, a good practice when using Angular 2 and Rx 阅读全文
posted @ 2016-04-26 03:26 Zhentiw 阅读(239) 评论(0) 推荐(0)
摘要:Instead of simply pushing numbers on a timer into the template, now we'll move on to pushing actual Dates. We'll still use the Async pipe, but we'll a 阅读全文
posted @ 2016-04-26 03:17 Zhentiw 阅读(250) 评论(0) 推荐(0)
摘要:Angular 2 templates use a special Async pipe to be able to render out Observables. This lesson covers the syntax used to create an Observable in Angul 阅读全文
posted @ 2016-04-26 03:12 Zhentiw 阅读(762) 评论(0) 推荐(0)
摘要:Create a Firebase Servcie: Display the list: 阅读全文
posted @ 2016-04-25 04:59 Zhentiw 阅读(238) 评论(0) 推荐(0)
摘要:Benefit to use child router is Angualr 2 then can lazy load the component on demand. Define a child router by adding three dots `/characters/...`: So 阅读全文
posted @ 2016-04-19 03:38 Zhentiw 阅读(501) 评论(0) 推荐(0)
摘要:When we define router in Angualr 2, we use @RouteConcfig() When we want to display component, we use <router-outlet> When we want to navigate to compo 阅读全文
posted @ 2016-04-18 02:40 Zhentiw 阅读(442) 评论(0) 推荐(0)
摘要:You can also use Promise for http: So for the service, you need to call toPromise() method: Then in your controller, you can get the Promise back: But 阅读全文
posted @ 2016-04-07 01:54 Zhentiw 阅读(295) 评论(0) 推荐(0)
摘要:Let's see how to track index when we use 'ngFor: <li *ngFor="#hero of heros | async; let i = index"> <hero-item [hero]="hero" (changed)="thisHero = $e 阅读全文
posted @ 2016-04-07 01:14 Zhentiw 阅读(740) 评论(1) 推荐(0)
摘要:Property Binding is bind property NOT attribute! So 'class' is attribute on DOM, but 'class.active' is an property. 'aria-label' is attribute, so need 阅读全文
posted @ 2016-04-06 03:23 Zhentiw 阅读(323) 评论(0) 推荐(0)
摘要:In Angular2, sometime we use @Output to pass data to parent component, then parent may pass the data down to another child component. When you want to 阅读全文
posted @ 2016-04-06 01:51 Zhentiw 阅读(187) 评论(0) 推荐(0)
摘要:When you want to access child component's method, you can use @ViewChild in the parent: Parent Component: Child Component: 阅读全文
posted @ 2016-04-05 01:00 Zhentiw 阅读(450) 评论(0) 推荐(0)
摘要:Async Pipe: The Asynce pipe receive a Promise or Observable as input and subscribes to the input, evetually emitting the value(s) changes arrive. In t 阅读全文
posted @ 2016-04-03 17:52 Zhentiw 阅读(374) 评论(0) 推荐(0)
摘要:TodoList.ts: TodoItemRender.ts: Current we pass [todo] to the itemRender from List, we actually can give @Input('name'): TodoList.ts: TodoItemRender.t 阅读全文
posted @ 2016-03-28 23:47 Zhentiw 阅读(233) 评论(0) 推荐(0)
摘要:Link: https://angular.io/docs/js/latest/api/core/OnInit-interface.html, https://www.youtube.com/watch?v=bY92HFyaBvo exported from angular2/core define 阅读全文
posted @ 2016-03-27 18:02 Zhentiw 阅读(1199) 评论(0) 推荐(0)
摘要:To use http, we need to import the HTTP_PROVIDER, so that we can inject http to other component: simple-request.ts: 阅读全文
posted @ 2016-03-25 04:02 Zhentiw 阅读(202) 评论(0) 推荐(0)
摘要:This lessons implements the Search Pipe with a new SearchBox component so you can search through each todo. It also demonstrates the patterns used for 阅读全文
posted @ 2016-03-23 03:45 Zhentiw 阅读(246) 评论(0) 推荐(0)
摘要:Link: Blog Single transclude: Multi-translcude: 阅读全文
posted @ 2016-03-23 03:07 Zhentiw 阅读(154) 评论(0) 推荐(0)
摘要:We want the start-pipe more flexable to get param, so when using it, we pass a second param as status: It will be handled as a second param which is a 阅读全文
posted @ 2016-03-22 19:29 Zhentiw 阅读(760) 评论(0) 推荐(0)
摘要:When a Todo property updates, you still must create a new Array of Todos and assign a new reference. This lesson walks you through refactoring from th 阅读全文
posted @ 2016-03-22 18:42 Zhentiw 阅读(241) 评论(0) 推荐(0)