随笔分类 -  Angular

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页
摘要:We are going to see how to using method arguments for @HostListener. First, we can use HostListener without method arguments: It works fine. But if we 阅读全文
posted @ 2017-07-23 21:07 Zhentiw 阅读(306) 评论(0) 推荐(0)
摘要:For example, we have a modal component, it can config that using ng-template as a configurable template. Now what we want to do is to pass in inputs t 阅读全文
posted @ 2017-07-02 20:14 Zhentiw 阅读(246) 评论(0) 推荐(0)
摘要:Now for au-modal component, we pass in tow component though contenct projection: One is 'au-tab-panel' which contains all the content body for modal. 阅读全文
posted @ 2017-07-02 19:33 Zhentiw 阅读(421) 评论(0) 推荐(0)
摘要:If we want to add global event handler, we can use 'EventManager' from '@angular/platform-broswer'. Now we have a modal component, we want to click 'E 阅读全文
posted @ 2017-07-02 19:14 Zhentiw 阅读(459) 评论(0) 推荐(0)
摘要:We have modal implement and now we want to implement close functionality. Becuase we use a structure directive to do open modal on click functionality 阅读全文
posted @ 2017-06-30 19:23 Zhentiw 阅读(209) 评论(0) 推荐(0)
摘要:For example we have two buttons: When we click nether one of those tow button, the modal should show up: We will use structure directive to do that. S 阅读全文
posted @ 2017-06-30 03:23 Zhentiw 阅读(398) 评论(0) 推荐(0)
摘要:We are going to have a modal component: And we can pass default modal body by content projection: So 'modal-body' will be shown by default. Now we wan 阅读全文
posted @ 2017-06-30 02:42 Zhentiw 阅读(238) 评论(0) 推荐(0)
摘要:Here is the defulat tab header template: we have set up that we can switch the default template when we pass in another template. Now, what we want is 阅读全文
posted @ 2017-06-20 02:50 Zhentiw 阅读(717) 评论(0) 推荐(0)
摘要:Previously we have tab-panel template defined like this: So the template is not overrideable. If we want later able to pass in a different template, w 阅读全文
posted @ 2017-06-20 02:29 Zhentiw 阅读(747) 评论(0) 推荐(0)
摘要:Angular allows us to conveniently use the async pipe to automatically register to RxJS observables and render the result into the template once the re 阅读全文
posted @ 2017-06-16 04:13 Zhentiw 阅读(190) 评论(0) 推荐(0)
摘要:The network may be unreliable and loading data may take time. Thus it is important to give the user some feedback about what's going on as fast as pos 阅读全文
posted @ 2017-06-14 23:19 Zhentiw 阅读(423) 评论(0) 推荐(0)
摘要:If sometime you want to log out the comonent html to see whether the html render correctly, you can do : If you found that some tmeplate binding doesn 阅读全文
posted @ 2017-06-12 20:14 Zhentiw 阅读(270) 评论(0) 推荐(0)
摘要:To add alernative theme, we can use :host-context() selector from Angular. So it will apply 'border-color: red' only when host wrapper element has 'au 阅读全文
posted @ 2017-06-11 02:15 Zhentiw 阅读(208) 评论(0) 推荐(0)
摘要:For the component's css file, we can improt two css files: common.css default-theme.css In the default theme, it contains all the default theme relate 阅读全文
posted @ 2017-06-11 02:06 Zhentiw 阅读(201) 评论(0) 推荐(0)
摘要:The API for the store is really simple: There are two methods, set() & select(). Store: interface: Component: 阅读全文
posted @ 2017-06-06 01:58 Zhentiw 阅读(308) 评论(0) 推荐(0)
摘要:For example you have a component, which take a trasclude input element: There is many ways to get ElementRef of the input, for example using Reference 阅读全文
posted @ 2017-06-01 04:07 Zhentiw 阅读(607) 评论(0) 推荐(0)
摘要:Let's say you are builing a reuseable component. The style structure like this: If you want to style this input field, it can be quite easy, we can ju 阅读全文
posted @ 2017-05-23 01:59 Zhentiw 阅读(270) 评论(0) 推荐(0)
摘要:NgZone, Angular uses it to profiling all the async actions such as setTimeout, http request and animation. For example if you dealing with heavy oprat 阅读全文
posted @ 2017-05-12 03:52 Zhentiw 阅读(1756) 评论(0) 推荐(0)
摘要:You probably have seen 'foorRoot()' method a lot inside Angular application. Creating a configurable NgModule allows us do the configuration for each 阅读全文
posted @ 2017-05-12 03:37 Zhentiw 阅读(221) 评论(0) 推荐(0)
摘要:Unlike 'useClass', 'useExisting' doesn't create a new instance when you register your service inside ngmodule. 'useExisting' also can limit the functi 阅读全文
posted @ 2017-05-11 04:32 Zhentiw 阅读(1078) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 23 下一页