Switching to Angular 2 by Minko Gechev

Switching to Angular 2 by Minko Gechev

Author:Minko Gechev [Gechev, Minko]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2016-03-29T22:00:00+00:00


Note

In order to get platform independent reference to a DOM element, again, we can use @ContentChildren and @ViewChildren. For instance, if we have the following template: <input #todo> we can get a reference to the input by using: @ViewChild('todo').

Since we are already familiar with the core differences between view children and content children now, we can continue with our tabs implementation.

In the tabs component, instead of using the @ContentChild decorator, we use @ContentChildren. We do this because we have multiple content children and we want to get them all:

@ContentChildren(TabTitle) tabTitles: QueryList<TabTitle>; @ContentChildren(TabContent) tabContents: QueryList<TabContent>;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.