随笔分类 -  Angular

摘要:Create a index.html: Index.html works as an App Shell, which render meanful pixel onto the screen. And our module will be rendered when the data bindi 阅读全文
posted @ 2016-09-13 15:22 Zhentiw 阅读(328) 评论(0) 推荐(0)
摘要:Let's say we have a list of contacts, click each contact, we can render a new route to get the detail. Define the routers: path: '', --> here empty pa 阅读全文
posted @ 2016-07-22 02:47 Zhentiw 阅读(404) 评论(0) 推荐(0)
摘要:Install: Create a project: Run the project: Change the port: Create a component: The component will be created in src/app/contact-list-component. Gene 阅读全文
posted @ 2016-07-20 02:19 Zhentiw 阅读(325) 评论(0) 推荐(0)
摘要:This lesson shows you how to build a Toggle Button in Angular 2 from scratch. It covers using transclusion in Angular 2, setting up your own two-way b 阅读全文
posted @ 2016-07-18 14:45 Zhentiw 阅读(456) 评论(0) 推荐(0)
摘要:When you use ngrx/store and you want to fire a service request. When it sucessfully return the response, you need to dispatch action to tell the store 阅读全文
posted @ 2016-06-24 03:02 Zhentiw 阅读(272) 评论(0) 推荐(0)
摘要:Orgial aritial --> Link The problem with Angular 1 DI: Angular 2 DI: Solve the singletons problem: The service you inject to the parent component can 阅读全文
posted @ 2016-06-12 03:45 Zhentiw 阅读(252) 评论(0) 推荐(0)
摘要:Oingial aritial --> Link Take away: When you use `templateUrl` & `styleUrls`, the path are relative to the application root. So if you compoennt is pu 阅读全文
posted @ 2016-06-11 22:32 Zhentiw 阅读(316) 评论(0) 推荐(0)
摘要:So How to do lazy loading for router in Angular 2. The nomarl way to write a router in Angular 2: You have SimpleCmp and UserCmp as child components. 阅读全文
posted @ 2016-05-31 02:15 Zhentiw 阅读(216) 评论(0) 推荐(0)
摘要:PWA: Add to home screen Angular Universal Server side rendering: for achieving better proference on init loading Angular 2 CLI ng new myapp --mobile s 阅读全文
posted @ 2016-05-27 01:54 Zhentiw 阅读(285) 评论(0) 推荐(0)
摘要:Check the Github: https://github.com/ngrx/devtools Example: 阅读全文
posted @ 2016-05-10 03:28 Zhentiw 阅读(321) 评论(0) 推荐(0)
摘要:@ngrx/store builds on the concepts made popular by Redux and supercharges it with the backing of RxJS. The result is a tool and philosophy that will t 阅读全文
posted @ 2016-05-01 04:19 Zhentiw 阅读(643) 评论(0) 推荐(0)
摘要:RxJS allows you to combine streams in various ways. This lesson shows you how to take a click stream and combine it with a store stream to use a value 阅读全文
posted @ 2016-04-28 04:10 Zhentiw 阅读(210) 评论(0) 推荐(0)
摘要:Reducers are also often used for changing a single property inside of other reducers. This lesson shows how a type can enter the people reducer, but t 阅读全文
posted @ 2016-04-28 03:53 Zhentiw 阅读(264) 评论(0) 推荐(0)
摘要:Add another reducer: Added a 'people' reducer, defined a 'defaultPeople' as default state. In bootstrap, add people reducer to the provideStore(). The 阅读全文
posted @ 2016-04-27 21:06 Zhentiw 阅读(213) 评论(0) 推荐(0)
摘要:The components inside of your container components can easily accept Observables. You simply define your custom @Input then use the Async pipe when yo 阅读全文
posted @ 2016-04-27 02:31 Zhentiw 阅读(578) 评论(0) 推荐(0)
摘要:Angular 2 allows you to pass values from inputs simply by referencing them in the template and passing them into your Subject.next() call. This lesson 阅读全文
posted @ 2016-04-27 02:00 Zhentiw 阅读(212) 评论(0) 推荐(0)
摘要:While action types allow you tell your reducer what action it should take, the payload is the data that your reducer will use to update the state. 阅读全文
posted @ 2016-04-27 01:52 Zhentiw 阅读(309) 评论(0) 推荐(0)
摘要:ngrx/store is a library that simplifies common RxJS patterns for managing state and gives you an easy api to use it within your Angular 2 application. 阅读全文
posted @ 2016-04-26 19:02 Zhentiw 阅读(301) 评论(0) 推荐(0)
摘要:While you have multiple streams flowing into your scan operator, you'll need to map each stream to the specific values you need to update your state t 阅读全文
posted @ 2016-04-26 18:14 Zhentiw 阅读(202) 评论(0) 推荐(0)
摘要:The scan operator in RxJS is the main key to managing values and states in your stream. Scan behaves just as a reduce function would, but scan is able 阅读全文
posted @ 2016-04-26 03:48 Zhentiw 阅读(246) 评论(0) 推荐(0)