Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
chore: update dynamic tabs example to bind to selected index
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Dec 23, 2015
1 parent 6c06778 commit 5b04345
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/components/tabs/dynamic_tabs.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<md-content class="md-padding">
<md-tabs md-selected="selectedIndex" md-border-bottom md-autoselect>
<md-tabs [selected]="selectedIndex" md-border-bottom md-autoselect>
<template md-tab *ngFor="var tab of tabs"
[disabled]="tab.disabled"
[label]="tab.title">
Expand Down
7 changes: 5 additions & 2 deletions examples/components/tabs/dynamic_tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export interface ITabData {
disabled?:boolean;
}

@Component({selector: 'tabs-dynamic-tabs'})
@Component({
selector: 'tabs-dynamic-tabs',
properties: ['selectedIndex']
})
@View({
templateUrl: 'examples/components/tabs/dynamic_tabs.html',
styleUrls: ['examples/components/tabs/dynamic_tabs.css'],
Expand All @@ -24,7 +27,7 @@ export default class TabsDynamicTabs {
selected = null;
previous = null;

private _selectedIndex: number = 0;
private _selectedIndex: number = 1;
@Input()
set selectedIndex(value: number) {
this.previous = this.selected;
Expand Down

0 comments on commit 5b04345

Please sign in to comment.