;
+
+ constructor() {
+ this.previousClick = 'Nothing';
+ this.action = "ACTIVATE";
+ this.clickCount = 0;
+ this.items = [1,2,3,4,5,6,7,8,9,0];
+ }
+
+ click(msg: string) {
+ this.previousClick = msg;
+ }
+
+ submit(msg: string, event) {
+ event.preventDefault();
+ this.previousClick = msg;
+ }
+
+ increment() {
+ this.clickCount++;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/checkbox/demo_app.html b/modules/examples/src/material/checkbox/demo_app.html
new file mode 100644
index 0000000000..cac15cdbf9
--- /dev/null
+++ b/modules/examples/src/material/checkbox/demo_app.html
@@ -0,0 +1,9 @@
+
+
Checkbox demo
+
+
Normal checkbox
+
Primary checkbox
+
Disabled checkbox
+
+
Toggle count: {{toggleCount}}
+
diff --git a/modules/examples/src/material/checkbox/index.html b/modules/examples/src/material/checkbox/index.html
new file mode 100644
index 0000000000..5f811095b1
--- /dev/null
+++ b/modules/examples/src/material/checkbox/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+ ng-material checkbox demo
+
+
+
+
+
+$SCRIPTS$
+ Loading...
+
+
diff --git a/modules/examples/src/material/checkbox/index.js b/modules/examples/src/material/checkbox/index.js
new file mode 100644
index 0000000000..d60c20d2a5
--- /dev/null
+++ b/modules/examples/src/material/checkbox/index.js
@@ -0,0 +1,31 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdCheckbox} from 'angular2_material/src/components/checkbox/checkbox'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app'
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdCheckbox]
+})
+class DemoApp {
+ toggleCount: number;
+
+ constructor() {
+ this.toggleCount = 0;
+ }
+
+ increment() {
+ this.toggleCount++;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/demo_common.js b/modules/examples/src/material/demo_common.js
new file mode 100644
index 0000000000..0223109593
--- /dev/null
+++ b/modules/examples/src/material/demo_common.js
@@ -0,0 +1,71 @@
+import {IMPLEMENTS, print} from 'angular2/src/facade/lang';
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {isPresent, isBlank, RegExpWrapper, StringWrapper, BaseException} from 'angular2/src/facade/lang';
+import {DOM} from 'angular2/src/dom/dom_adapter';
+import {Injectable} from 'angular2/di';
+import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
+import {reflector} from 'angular2/src/reflection/reflection';
+import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
+
+export function commonDemoSetup(): void {
+ BrowserDomAdapter.makeCurrent();
+ reflector.reflectionCapabilities = new ReflectionCapabilities();
+}
+
+@Injectable()
+@IMPLEMENTS(UrlResolver)
+export class DemoUrlResolver {
+ static a;
+
+ isInPubServe:boolean;
+
+ constructor() {
+ if (isBlank(UrlResolver.a)) {
+ UrlResolver.a = DOM.createElement('a');
+ }
+ this.isInPubServe = _isInPubServe();
+ }
+
+ resolve(baseUrl: string, url: string): string {
+ if (isBlank(baseUrl)) {
+ DOM.resolveAndSetHref(UrlResolver.a, url, null);
+ return DOM.getHref(UrlResolver.a);
+ }
+
+ if (isBlank(url) || url == '') return baseUrl;
+
+ if (url[0] == '/') {
+ throw new BaseException(`Could not resolve the url ${url} from ${baseUrl}`);
+ }
+
+ var m = RegExpWrapper.firstMatch(_schemeRe, url);
+
+ if (isPresent(m[1])) {
+ return url;
+ }
+
+ if (StringWrapper.startsWith(url, './')) {
+ return `${baseUrl}/${url}`;
+ }
+
+ if (this.isInPubServe) {
+ return `/packages/${url}`;
+ } else {
+ return `/${url}`;
+ }
+ }
+}
+
+var _schemeRe = RegExpWrapper.create('^([^:/?#]+:)?');
+
+// TODO: remove this hack when http://dartbug.com/23128 is fixed
+function _isInPubServe():boolean {
+ try {
+ int.parse('123');
+ print('>> Running in Dart');
+ return true;
+ } catch(_) {
+ print('>> Running in JS');
+ return false;
+ }
+}
diff --git a/modules/examples/src/material/grid_list/demo_app.html b/modules/examples/src/material/grid_list/demo_app.html
new file mode 100644
index 0000000000..7ce072e541
--- /dev/null
+++ b/modules/examples/src/material/grid_list/demo_app.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
grid-list demo
+
+
+
+
+ Tile #1
+
+
+
+ Tile #2
+
+
+
+ Tile #3
+
+
+
+
+
diff --git a/modules/examples/src/material/grid_list/index.html b/modules/examples/src/material/grid_list/index.html
new file mode 100644
index 0000000000..4beb8fe846
--- /dev/null
+++ b/modules/examples/src/material/grid_list/index.html
@@ -0,0 +1,20 @@
+
+
+
+
+ ng-material grid-list demo
+
+
+
+
+
+$SCRIPTS$
+
+ Loading...
+
+
+
diff --git a/modules/examples/src/material/grid_list/index.js b/modules/examples/src/material/grid_list/index.js
new file mode 100644
index 0000000000..2d938c90ad
--- /dev/null
+++ b/modules/examples/src/material/grid_list/index.js
@@ -0,0 +1,30 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdGridList, MdGridTile} from 'angular2_material/src/components/grid_list/grid_list'
+import {MdTheme} from 'angular2_material/src/core/theme'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app'
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdGridList, MdGridTile]
+})
+class DemoApp {
+ tile3RowSpan: number;
+ tile3ColSpan: number;
+
+ constructor() {
+ this.tile3RowSpan = 3;
+ this.tile3ColSpan = 3;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/input/demo_app.html b/modules/examples/src/material/input/demo_app.html
new file mode 100644
index 0000000000..dcb97f4e92
--- /dev/null
+++ b/modules/examples/src/material/input/demo_app.html
@@ -0,0 +1,10 @@
+
+
+
input demo
+
+
+
+
+
+
+
diff --git a/modules/examples/src/material/input/index.html b/modules/examples/src/material/input/index.html
new file mode 100644
index 0000000000..8ddc4729bf
--- /dev/null
+++ b/modules/examples/src/material/input/index.html
@@ -0,0 +1,19 @@
+
+
+
+
+ ng-material input demo
+
+
+
+
+
+ $SCRIPTS$
+
+ Loading...
+
+
diff --git a/modules/examples/src/material/input/index.js b/modules/examples/src/material/input/index.js
new file mode 100644
index 0000000000..d60c20d2a5
--- /dev/null
+++ b/modules/examples/src/material/input/index.js
@@ -0,0 +1,31 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdCheckbox} from 'angular2_material/src/components/checkbox/checkbox'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app'
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdCheckbox]
+})
+class DemoApp {
+ toggleCount: number;
+
+ constructor() {
+ this.toggleCount = 0;
+ }
+
+ increment() {
+ this.toggleCount++;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/progress-linear/demo_app.html b/modules/examples/src/material/progress-linear/demo_app.html
new file mode 100644
index 0000000000..5f99e6ff0a
--- /dev/null
+++ b/modules/examples/src/material/progress-linear/demo_app.html
@@ -0,0 +1,42 @@
+
+
+
+
Progress-linear demo
+
+
+ Determinate: primary
+
+
+
+
+
+ Determinate: accent
+
+
+
+
+
+ Buffer
+
+
+
+
+
+ Indeterminate
+
+
+
+
+
+ Query
+
+
+
+
+
+
+
Progress: {{progress}}
+
+
+
diff --git a/modules/examples/src/material/progress-linear/index.html b/modules/examples/src/material/progress-linear/index.html
new file mode 100644
index 0000000000..831ce43345
--- /dev/null
+++ b/modules/examples/src/material/progress-linear/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+ ng-material progress-linear demo
+
+
+
+
+
+$SCRIPTS$
+ Loading...
+
+
diff --git a/modules/examples/src/material/progress-linear/index.js b/modules/examples/src/material/progress-linear/index.js
new file mode 100644
index 0000000000..fc67ab81a1
--- /dev/null
+++ b/modules/examples/src/material/progress-linear/index.js
@@ -0,0 +1,31 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdProgressLinear} from 'angular2_material/src/components/progress-linear/progress_linear'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app'
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdProgressLinear]
+})
+class DemoApp {
+ progress: number;
+
+ constructor() {
+ this.progress = 40;
+ }
+
+ step(s: number) {
+ this.progress += s;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/radio/demo_app.html b/modules/examples/src/material/radio/demo_app.html
new file mode 100644
index 0000000000..d143376606
--- /dev/null
+++ b/modules/examples/src/material/radio/demo_app.html
@@ -0,0 +1,35 @@
+
+
Radio buttons
+
Inside of a radiogroup
+
+
+ Star Wars
+ Star Trek
+ Battlestar Galactica
+ Dr. Who
+
+
+
Your selection: {{scifi.value}}
+
radio group value change count: {{groupValueChangeCount}}
+
+
+
Standalone
+
+
Earth
+
Fire
+
Wind
+
Heart (disabled)
+
+
individual radio value change count: {{individualValueChanges}}
+
+
+
Disabled radio group
+
Chosen: {{pokemon}}
+
+ Charmander
+ Bulbasaur
+ Squirtle
+
+
+
+
diff --git a/modules/examples/src/material/radio/index.html b/modules/examples/src/material/radio/index.html
new file mode 100644
index 0000000000..d39033ce6d
--- /dev/null
+++ b/modules/examples/src/material/radio/index.html
@@ -0,0 +1,20 @@
+
+
+
+
+ ng-material radio demo
+
+
+
+
+
+$SCRIPTS$
+
+ Loading...
+
+
+
diff --git a/modules/examples/src/material/radio/index.js b/modules/examples/src/material/radio/index.js
new file mode 100644
index 0000000000..6724c27ce5
--- /dev/null
+++ b/modules/examples/src/material/radio/index.js
@@ -0,0 +1,49 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdRadioButton, MdRadioGroup} from 'angular2_material/src/components/radio/radio_button'
+import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app',
+ injectables: [MdRadioDispatcher]
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdRadioGroup, MdRadioButton]
+})
+class DemoApp {
+ thirdValue;
+ groupValueChangeCount;
+ individualValueChanges;
+ pokemon;
+ someTabindex;
+
+ constructor() {
+ this.thirdValue = 'dr-who';
+ this.groupValueChangeCount = 0;
+ this.individualValueChanges = 0;
+ this.pokemon = '';
+ this.someTabindex = 888;
+ }
+
+ chooseCharmander() {
+ this.pokemon = 'fire';
+ }
+
+ onGroupChange() {
+ this.groupValueChangeCount++;
+ }
+
+ onIndividualClick() {
+ this.individualValueChanges++;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/modules/examples/src/material/switcher/demo_app.html b/modules/examples/src/material/switcher/demo_app.html
new file mode 100644
index 0000000000..50dc84ed57
--- /dev/null
+++ b/modules/examples/src/material/switcher/demo_app.html
@@ -0,0 +1,9 @@
+
+
Switch demo
+
+
Normal switch
+
Primary switch
+
Disabled switch
+
+
Toggle count: {{toggleCount}}
+
diff --git a/modules/examples/src/material/switcher/index.html b/modules/examples/src/material/switcher/index.html
new file mode 100644
index 0000000000..b521ba8659
--- /dev/null
+++ b/modules/examples/src/material/switcher/index.html
@@ -0,0 +1,19 @@
+
+
+
+
+ ng-material switch demo
+
+
+
+
+
+ $SCRIPTS$
+
+ Loading...
+
+
diff --git a/modules/examples/src/material/switcher/index.js b/modules/examples/src/material/switcher/index.js
new file mode 100644
index 0000000000..bdd61b41d7
--- /dev/null
+++ b/modules/examples/src/material/switcher/index.js
@@ -0,0 +1,31 @@
+import {bootstrap, Component, View} from 'angular2/angular2';
+import {MdSwitch} from 'angular2_material/src/components/switcher/switch'
+import {UrlResolver} from 'angular2/src/services/url_resolver';
+import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
+import {bind} from 'angular2/di';
+
+@Component({
+ selector: 'demo-app'
+})
+@View({
+ templateUrl: './demo_app.html',
+ directives: [MdSwitch]
+})
+class DemoApp {
+ toggleCount: number;
+
+ constructor() {
+ this.toggleCount = 0;
+ }
+
+ increment() {
+ this.toggleCount++;
+ }
+}
+
+export function main() {
+ commonDemoSetup();
+ bootstrap(DemoApp, [
+ bind(UrlResolver).toValue(new DemoUrlResolver())
+ ]);
+}
diff --git a/package.json b/package.json
index ccaf4fb117..bbb2f54d85 100644
--- a/package.json
+++ b/package.json
@@ -61,6 +61,7 @@
"fs-extra": "^0.16.4",
"glob": "^4.0.6",
"gulp": "^3.8.8",
+ "gulp-autoprefixer": "^2.1.0",
"gulp-changed": "^1.0.0",
"gulp-clang-format": "^1.0.3",
"gulp-concat": "^2.5.2",
@@ -68,6 +69,7 @@
"gulp-jasmine": "^1.0.1",
"gulp-load-plugins": "^0.7.1",
"gulp-rename": "^1.2.0",
+ "gulp-sass": "^1.3.3",
"gulp-shell": "^0.2.10",
"gulp-sourcemaps": "1.3.*",
"gulp-template": "^3.0.0",
diff --git a/tools/broccoli/trees/dart_tree.ts b/tools/broccoli/trees/dart_tree.ts
index 8a3077fb79..48f4386781 100644
--- a/tools/broccoli/trees/dart_tree.ts
+++ b/tools/broccoli/trees/dart_tree.ts
@@ -132,7 +132,7 @@ function getDocsTree() {
var mdTree = stew.rename(modulesFunnel(['**/*.dart.md']),
relativePath => relativePath.replace(/\.dart\.md$/, '.md'));
// Copy all assets, ignore .js. and .dart. (handled above).
- var docs = modulesFunnel(['**/*.md', '**/*.png', '**/*.html', '**/*.css'],
+ var docs = modulesFunnel(['**/*.md', '**/*.png', '**/*.html', '**/*.css', '**/*.scss'],
['**/*.js.md', '**/*.dart.md']);
return mergeTrees([licenses, mdTree, docs]);
}