diff --git a/examples/app.html b/examples/app.html
index 45713042..cfb28f1b 100644
--- a/examples/app.html
+++ b/examples/app.html
@@ -10,6 +10,12 @@
+
+ Tab1
+ Tab2
+ Tab3
+
+
Getting Started
@@ -26,7 +32,6 @@ Components
-
{{ value.name }}
diff --git a/ng2-material/components/button/button.html b/ng2-material/components/button/button.html
deleted file mode 100644
index 4e3df0e2..00000000
--- a/ng2-material/components/button/button.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/ng2-material/components/button/button.ts b/ng2-material/components/button/button.ts
index 89677dca..65cd459a 100644
--- a/ng2-material/components/button/button.ts
+++ b/ng2-material/components/button/button.ts
@@ -7,6 +7,8 @@ import {Ink} from "../../core/util/ink";
import {Attribute} from "angular2/core";
+const BUTTON_TEMPLATE = ``;
+
// TODO(jelbourn): Make the `isMouseDown` stuff done with one global listener.
@Component({
@@ -19,8 +21,7 @@ import {Attribute} from "angular2/core";
},
})
@View({
- templateUrl: 'ng2-material/components/button/button.html',
- //styleUrls: ['ng2-material/components/button/button.css'],
+ template: BUTTON_TEMPLATE,
encapsulation: ViewEncapsulation.None,
})
export class MdButton {
@@ -72,7 +73,7 @@ export class MdButton {
},
})
@View({
- templateUrl: 'ng2-material/components/button/button.html',
+ template: BUTTON_TEMPLATE,
encapsulation: ViewEncapsulation.None
})
export class MdAnchor extends MdButton implements OnChanges {
diff --git a/ng2-material/components/checkbox/checkbox.html b/ng2-material/components/checkbox/checkbox.html
deleted file mode 100644
index 86d69aba..00000000
--- a/ng2-material/components/checkbox/checkbox.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/ng2-material/components/checkbox/checkbox.ts b/ng2-material/components/checkbox/checkbox.ts
index 5de2b252..4eeb7db1 100644
--- a/ng2-material/components/checkbox/checkbox.ts
+++ b/ng2-material/components/checkbox/checkbox.ts
@@ -19,7 +19,13 @@ import {Input, Output, EventEmitter} from 'angular2/core';
}
})
@View({
- templateUrl: 'ng2-material/components/checkbox/checkbox.html',
+ template: `
+ `,
directives: [],
encapsulation: ViewEncapsulation.None
})
diff --git a/ng2-material/components/dialog/dialog.html b/ng2-material/components/dialog/dialog.html
deleted file mode 100644
index f965d6a8..00000000
--- a/ng2-material/components/dialog/dialog.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/ng2-material/components/dialog/dialog.ts b/ng2-material/components/dialog/dialog.ts
index 28161343..446fccaf 100644
--- a/ng2-material/components/dialog/dialog.ts
+++ b/ng2-material/components/dialog/dialog.ts
@@ -213,7 +213,9 @@ export class MdDialogConfig {
})
@View({
encapsulation: ViewEncapsulation.None,
- templateUrl: 'ng2-material/components/dialog/dialog.html',
+ template: `
+
+ `,
directives: [forwardRef(() => MdDialogContent)]
})
class MdDialogContainer {
diff --git a/ng2-material/components/grid_list/grid_list.html b/ng2-material/components/grid_list/grid_list.html
deleted file mode 100644
index 6a1d43b5..00000000
--- a/ng2-material/components/grid_list/grid_list.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/ng2-material/components/grid_list/grid_list.ts b/ng2-material/components/grid_list/grid_list.ts
index 6c135e6c..575adcf2 100644
--- a/ng2-material/components/grid_list/grid_list.ts
+++ b/ng2-material/components/grid_list/grid_list.ts
@@ -29,7 +29,10 @@ class RowHeightMode {
@Component({selector: 'md-grid-list', inputs: ['cols', 'rowHeight', 'gutterSize']})
@View({
- templateUrl: 'ng2-material/components/grid_list/grid_list.html',
+ template: `
+
+
+
`,
encapsulation: ViewEncapsulation.None
})
export class MdGridList implements AfterContentChecked {
@@ -226,7 +229,11 @@ export class MdGridList implements AfterContentChecked {
}
})
@View({
- templateUrl: 'ng2-material/components/grid_list/grid_tile.html',
+ template: `
+
+ `,
encapsulation: ViewEncapsulation.None
})
export class MdGridTile implements OnDestroy,
diff --git a/ng2-material/components/grid_list/grid_tile.html b/ng2-material/components/grid_list/grid_tile.html
deleted file mode 100644
index 8fb81735..00000000
--- a/ng2-material/components/grid_list/grid_tile.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/ng2-material/components/icon/icon.html b/ng2-material/components/icon/icon.html
deleted file mode 100644
index 0d8b32a2..00000000
--- a/ng2-material/components/icon/icon.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ng2-material/components/list/list.ts b/ng2-material/components/list/list.ts
index 03697498..0f1479d6 100644
--- a/ng2-material/components/list/list.ts
+++ b/ng2-material/components/list/list.ts
@@ -75,9 +75,11 @@ export class MdList {
properties: ['wrap']
})
@View({
- templateUrl: 'ng2-material/components/list/list_item.html'
+ template: `
+
+
+
`
})
-
export class MdListItem implements AfterViewInit {
constructor(private _element: ElementRef) {
}
diff --git a/ng2-material/components/list/list_item.html b/ng2-material/components/list/list_item.html
deleted file mode 100644
index 629066b2..00000000
--- a/ng2-material/components/list/list_item.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/ng2-material/components/progress_circular/progress_circular.html b/ng2-material/components/progress_circular/progress_circular.html
deleted file mode 100644
index 162cb601..00000000
--- a/ng2-material/components/progress_circular/progress_circular.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/ng2-material/components/progress_circular/progress_circular.ts b/ng2-material/components/progress_circular/progress_circular.ts
index a8a5208e..5e9786e4 100644
--- a/ng2-material/components/progress_circular/progress_circular.ts
+++ b/ng2-material/components/progress_circular/progress_circular.ts
@@ -3,7 +3,18 @@ import {MdProgressLinear} from '../progress_linear/progress_linear';
@Component({selector: 'md-progress-circular'})
@View({
- templateUrl: 'ng2-material/components/progress_circular/progress_circular.html',
+ template: `
+ `,
encapsulation: ViewEncapsulation.None
})
export class MdProgressCircular extends MdProgressLinear {
diff --git a/ng2-material/components/progress_linear/progress_linear.html b/ng2-material/components/progress_linear/progress_linear.html
deleted file mode 100644
index f3f431f3..00000000
--- a/ng2-material/components/progress_linear/progress_linear.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
diff --git a/ng2-material/components/progress_linear/progress_linear.ts b/ng2-material/components/progress_linear/progress_linear.ts
index 9d76e018..5162607d 100644
--- a/ng2-material/components/progress_linear/progress_linear.ts
+++ b/ng2-material/components/progress_linear/progress_linear.ts
@@ -24,7 +24,14 @@ class ProgressMode {
}
})
@View({
- templateUrl: 'ng2-material/components/progress_linear/progress_linear.html',
+ template: `
+ `,
directives: [],
encapsulation: ViewEncapsulation.None
})
diff --git a/ng2-material/components/radio/radio_button.html b/ng2-material/components/radio/radio_button.html
deleted file mode 100644
index 1f7678d9..00000000
--- a/ng2-material/components/radio/radio_button.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
diff --git a/ng2-material/components/radio/radio_button.ts b/ng2-material/components/radio/radio_button.ts
index 5b99c46a..e52b57c4 100644
--- a/ng2-material/components/radio/radio_button.ts
+++ b/ng2-material/components/radio/radio_button.ts
@@ -41,7 +41,7 @@ var _uniqueIdCounter: number = 0;
}
})
@View({
- templateUrl: 'ng2-material/components/radio/radio_group.html',
+ template: ``,
encapsulation: ViewEncapsulation.None
})
export class MdRadioGroup implements OnChanges {
@@ -220,7 +220,21 @@ export class MdRadioGroup implements OnChanges {
}
})
@View({
- templateUrl: 'ng2-material/components/radio/radio_button.html',
+ template: `
+
+ `,
directives: [],
encapsulation: ViewEncapsulation.None
})
diff --git a/ng2-material/components/radio/radio_group.html b/ng2-material/components/radio/radio_group.html
deleted file mode 100644
index 6dbc7430..00000000
--- a/ng2-material/components/radio/radio_group.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/ng2-material/components/switcher/switch.html b/ng2-material/components/switcher/switch.html
deleted file mode 100644
index 6dd68442..00000000
--- a/ng2-material/components/switcher/switch.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
diff --git a/ng2-material/components/switcher/switch.ts b/ng2-material/components/switcher/switch.ts
index c16877fb..d2e346b0 100644
--- a/ng2-material/components/switcher/switch.ts
+++ b/ng2-material/components/switcher/switch.ts
@@ -16,7 +16,16 @@ import {MdCheckbox} from '../checkbox/checkbox';
}
})
@View({
- templateUrl: 'ng2-material/components/switcher/switch.html',
+ template: `
+
+
+
+
`,
directives: [],
encapsulation: ViewEncapsulation.None
})
diff --git a/ng2-material/components/tabs/tabs.html b/ng2-material/components/tabs/tabs.html
deleted file mode 100644
index 9dfb7d69..00000000
--- a/ng2-material/components/tabs/tabs.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
- {{pane.label}}
-
-
-
-
-
-
-
-
-
-
diff --git a/ng2-material/components/tabs/tabs.ts b/ng2-material/components/tabs/tabs.ts
index e2199758..4341874c 100644
--- a/ng2-material/components/tabs/tabs.ts
+++ b/ng2-material/components/tabs/tabs.ts
@@ -5,6 +5,7 @@ import {
import {isPresent} from "angular2/src/facade/lang";
import {Ink} from "../../core/util/ink";
import {ViewEncapsulation} from "angular2/core";
+import {NgFor} from "angular2/common";
// TODO: behaviors to test
@@ -49,7 +50,32 @@ export class MdTab {
@Component({
selector: 'md-tabs',
- templateUrl: 'ng2-material/components/tabs/tabs.html',
+ template: `
+
+
+
+
+
+ {{pane.label}}
+
+
+
+
+
+
+
+
+
+ `,
+ directives: [NgFor],
encapsulation: ViewEncapsulation.None
})
export class MdTabs implements AfterContentInit {
@@ -85,7 +111,12 @@ export class MdTabs implements AfterContentInit {
}
select(pane: MdTab) {
- this.panes.toArray().forEach((p: MdTab) => p.active = p == pane);
+ this.panes.toArray().forEach((p: MdTab, index: number) => {
+ p.active = p == pane;
+ if (p.active) {
+ this._selectedIndex = index;
+ }
+ });
}
onTabClick(pane: MdTab, event?) {