October 2017
Intermediate to advanced
280 pages
6h 50m
English
Let's take a look at the implementation of a sample Tabs component, which uses the following structure:
<tabs (changed)="tabChanged($event)">
<tab-title>Tab 1</tab-title>
<tab-content>Content 1</tab-content>
<tab-title>Tab 2</tab-title>
<tab-content>Content 2</tab-content>
</tabs>
The preceding structure is composed of three components:
Let's take a look at the implementation of the TabTitle component:
@Component({ selector: 'tab-title', styles: [...], template: ` <div class="tab-title" (click)="handleClick()"> <ng-content></ng-content> </div> ` }) class TabTitle { @Output() tabSelected: EventEmitter<TabTitle> = new EventEmitter<TabTitle>(); ...Read now
Unlock full access