随笔分类 - Angular
摘要:For example we have a component: For TodoAppComponent, we make 'TodoList' as 'viewProviders'. And inside TodoAppComponent, we have TodoInputComponent
阅读全文
摘要:Content is what is passed as children. View is the template of the current component. The view is initialized before the content and ngAfterViewInit()
阅读全文
摘要:*The children element which are located inside of its template of a component are called *view children *. On the other hand, **elements which are use
阅读全文
摘要:We have looked at @ContentChild in article(http://www.cnblogs.com/Answer1215/p/6414657.html). Now let's how to query multi children by using @ContentC
阅读全文
摘要:@ContentChild normally works with ngAfterContentInit lifecycle. @ContentChild is used for looking into child component's props. For example, we a app
阅读全文
摘要:For example there is tow form compoennts on the page, and what we want to do is reusing the form component. Make to tow form behave differently, we ca
阅读全文
摘要:The default core theme comes preinstalled and ready to go with every new project. Learn how to use some of the many helpful utility classes that are p
阅读全文
摘要:Install: Create: Run: List all emulators: Run a different emulator: Livesync: Run with emulator: If you omit device 'ios', it will run both Android an
阅读全文
摘要:
阅读全文
摘要:From: To: So we create a index.ts file inside 'store' folder:
阅读全文
摘要:To understand how change detection can help us improve the proference, we need to understand when it works first. There are some rules which can be ap
阅读全文
摘要:Let's say the message list can Input (messages) from parent component, and what we want to do is when there are new message, we will scroll message li
阅读全文
摘要:For the first Effect, will trigger another action: Second effect: will trigger another action:
阅读全文
摘要:See the current implementaion of code, we have a smart component, and inside the smart component we are using both 'serivce' and 'store'. In the large
阅读全文
摘要:When using Radio button for Tamplate driven form, we want to change to the value change and preform some action.
阅读全文
摘要:import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/observable/throw'; updatePassenger(passenger: Passenger): Observabl...
阅读全文
摘要:What could be the issue, for example we have two list: Parent component: Child component: They both display list of "passengers". What will happens th
阅读全文
摘要:The structure directive is just a sugar syntax of <template>. Such as: Equal to:
阅读全文
摘要:You need to define a <template> to be able to use it elsewhere in your app as a TemplateRef. You can store these TemplateRefs in a Service and then ac
阅读全文
摘要:Just like passing in an array to *ngFor, you can pass in any value into your structural directive so that it can render templates based on those value
阅读全文