From 6b5fc527363a08583ac63e18bcb19b4f4737ddcd Mon Sep 17 00:00:00 2001
From: Sam Jones
Date: Wed, 12 Oct 2016 19:44:56 -0400
Subject: [PATCH] feat(angular2): update to 2.0.x and latest @angular/material
* dev: Setup for VS Code
I needed some config changes for my developer setup on windows.
* Update dependencies
Update dependencies to @angular rc.5 and @angular2-material to alpha.7-4
* dev: Drop tests
Remove tests from build to simplify upgrade. Testing using our own example app.
* Remove modules to be replaced
Removing modules that were recommended to be superceeded by their @angular2-material counterparts in [this gist] (https://gist.github.com/ollwenjones/d33b181773d8c8d7f4293cf6e6c4005b) by @ollwenjones
Leaving scss for our example app.
* Pagination NgModule class and Pagination bugfixes
Created Pagination NgModule class and corrected TS compiler and Angular errors.
* Created MdContentModule
Created NgModule for MdContent directive
* Created MdDataTableModule
Created NgModule class for MdDataTable
* Created MdDividerModule
Created NgModule class for MdDivider
* Created MdPeekabooModule
Created NgModule class for MdPeekaboo
* Created MdValidatorModule
Created NgModule class for Md* validator directives
* Created MdSubheaderModule
Created NgModule class for MdSubheader
* Created MdBackdropModule
Created NgModule class for MdBackdrop
* Created Ng2MaterialModule and Ng2MaterialNodeModule
Create NgModule classes for ng2-material in Node.js and browser.
Removed exports from deprecated/removed modules.
* 0.7.0-0
* Remove pagination service from model
Will need to be provided on the component level.
* Upgrade zone & add karma shims
This doesn't make tests run yet, but needs to be done
* Feature/angular rc7 q free (#302)
* Remove unused styles
We are using the angular2-material equivalents of these styles
* Fix shadowed input
The `range-format` input of md-pagination-range was getting overriden by the null value of the parent pagination directive.
* Update to Angular rc.6 and Typescript 2.0
- Updated all package deps to their latest versions.
- Updated just enough code to make the typescript compiler happy with new
packages. Have not tested components other than the ones in our demo
app.
- Fixed pagination require from unstable source. Only imports from the
root of @angular modules are to be trusted
- Removed MdCard styles from components barell.
- Added forRoot static method to both Ng2MaterialModule versions.
* Update to rc.7
Update dependencies to rc7, not observing any necessary code changes.
* Use local installation of typescript to build
* bump pre version
* Update dependencies to @angular 2.0.0 versions
* Update Angular Material to v alpha.8-2
Alpha 8-2 has updated dependencies to angular 2.0.0
* Update to @angular/material
The angular material 2 project has changed their packaging. They now distribute everything under the single package `@angular/material`.
Updated package files and removed references to any `@angular2-material/*` packages
* Set default-theme values to default
Setting default theme variables to default so that they can be overidden in app.
* Bump version
* chore: remove example app spec files
- we don't add any testing to the example site, so they're just noise.
* chore: use typescript 2 with grunt ts
- remove grunt-exec and specify a custom typescript compiler location in the grunt-ts configuration
* chore: remove card component and tests
- as pointed out by @ollwenjones the styles are different than the official material2 implementation. let's avoid confusion. todo: look at updating the card examples (or remove them if it's too much work)
* chore: stash working changes to update test suite to use the latest angular apis
- use TestBed for specs
- update componentSanityCheck to use TestBed
- update karma and systemjs configs to look like angular2 quickstart (https://github.com/angular/quickstart)
- remove `main` function wrapper in test files and call describe when the module is imported (again to match angular/quickstart)
- add dialog module
- break pagination tests into individual files
- add MdServicesModule for importing services
BREAKING CHANGE: remove md-card component
The card component conflicts with the official @angular/material/card implementation. Please use the official component. For more information see: https://github.com/angular/material2/tree/master/src/lib/card
* chore: remove form md-messages
- the forms module has changed quite a bit and look competent enough to exist without these components.
BREAKING CHANGE: removed md-messages components and prefer to use standard FormsModule
* chore: fix up test suite
- use async() to wrap any it() or beforeEach() calls that do promise based async stuff.
- use `TestBed.get(ServiceTypeName)` instead of `inject()` when a service instance is needed in a test.
* chore: reduce sauce test matrix
BREAKING CHANGE: Remove support for automated testing of IE and unreliable builds of Chrome beta.
* chore: reduce sauce test matrix
BREAKING CHANGE: Remove support for automated testing of Chrome 39 and Android 4.4
* test: add spec to dialog component
* chore: fix bad package name
* feat(readme): update readme to direct new users to @angular/material
- move some testing stuff out of the first line
- update language to downplay any suggestion that users should create issues. Instead suggest they provide a fix for the community.
- remove gitter link (I never monitor it despite good intentions.)
* chore: drop android from sauce and add dev/beta for chrome/firefox
- Android is failing to start sometimes. I have no patience for sauce flakiness.
- Make all browsers run on Windows 10 in an attempt to reduce test start times
---
.editorconfig | 1 -
.travis.yml | 7 +-
.vscode/settings.json | 4 +
Gruntfile.js | 4 +
README.md | 17 +-
config.karma.js | 12 +-
karma-test-shim.js | 89 ++
karma.conf.js | 33 +-
karma.ie.shims.js | 253 -----
karma.main.js | 21 -
karma.sauce.conf.js | 19 +-
modules/site/angular-cli-build.js | 2 +-
modules/site/e2e/app.e2e.ts | 14 -
modules/site/e2e/app.po.ts | 9 -
modules/site/e2e/tsconfig.json | 17 -
modules/site/e2e/typings.d.ts | 1 -
modules/site/package.json | 10 +-
.../+components/components.component.spec.ts | 43 -
.../site/src/app/+index/index.component.html | 2 +-
.../src/app/+index/index.component.spec.ts | 41 -
.../button-basic-usage.component.spec.ts | 41 -
.../card-action-buttons.component.spec.ts | 42 -
.../card/card-basic-usage.component.spec.ts | 42 -
.../card-inline-actions.component.spec.ts | 42 -
.../checkbox-basic-usage.component.spec.ts | 42 -
.../checkbox-basic-usage.component.ts | 3 +-
.../site/src/app/examples/checkbox/readme.md | 6 +-
.../data-table-basic-usage.component.spec.ts | 42 -
...ta-table-selectable-rows.component.spec.ts | 42 -
.../data-table-selectable-rows.component.ts | 5 +-
.../dialog-basic-usage.component.spec.ts | 42 -
.../dialog/dialog-basic-usage.component.ts | 4 +-
.../elevation-basic-usage.component.spec.ts | 42 -
.../input/input-basic-usage.component.spec.ts | 42 -
.../input/input-basic-usage.component.ts | 6 +-
modules/site/src/app/examples/input/readme.md | 6 +-
.../list/list-basic-usage.component.spec.ts | 42 -
.../pagination-basic-usage.component.spec.ts | 44 -
.../pagination-split-usage.component.spec.ts | 44 -
...progress-bar-basic-usage.component.spec.ts | 42 -
.../progress-bar-basic-usage.component.ts | 3 +-
.../src/app/examples/progress-bar/readme.md | 6 +-
...gress-circle-basic-usage.component.spec.ts | 43 -
.../progress-circle-basic-usage.component.ts | 2 +-
.../app/examples/progress-circle/readme.md | 6 +-
.../radio/radio-basic-usage.component.spec.ts | 42 -
.../radio/radio-basic-usage.component.ts | 5 +-
modules/site/src/app/examples/radio/readme.md | 6 +-
.../site/src/app/examples/sidenav/readme.md | 6 +-
.../sidenav-basic-usage.component.spec.ts | 42 -
.../sidenav/sidenav-basic-usage.component.ts | 3 +-
.../switch-basic-usage.component.spec.ts | 42 -
modules/site/src/app/examples/tabs/readme.md | 6 +-
.../tabs-dynamic-height.component.spec.ts | 42 -
.../tabs/tabs-dynamic-height.component.ts | 4 +-
.../tabs/tabs-dynamic-tabs.component.spec.ts | 42 -
.../tabs/tabs-dynamic-tabs.component.ts | 5 +-
.../site/src/app/examples/toolbar/readme.md | 6 +-
.../toolbar-basic-usage.component.spec.ts | 42 -
.../toolbar/toolbar-basic-usage.component.ts | 4 +-
.../shared/example/example.component.spec.ts | 41 -
.../app/shared/example/example.component.ts | 7 +-
.../shared/footer/footer.component.spec.ts | 41 -
.../src/app/shared/footer/footer.component.ts | 6 +-
.../highlight-container.component.spec.ts | 42 -
.../highlight/highlight.component.spec.ts | 45 -
modules/site/src/app/site.component.spec.ts | 17 -
modules/site/src/app/site.component.ts | 15 +-
modules/site/src/system-config.ts | 14 +-
modules/webpack/package.json | 3 +-
modules/webpack/src/main.ts | 9 +-
ng2-material.d.ts | 1 -
package.json | 111 ++-
src/.baseDir.ts | 1 +
src/components.scss | 5 -
src/components/backdrop/backdrop.ts | 16 +-
src/components/backdrop/backdrop_spec.ts | 404 ++++----
src/components/button/button.scss | 283 ------
src/components/button/button.ts | 100 --
src/components/button/button_spec.ts | 178 ----
src/components/card/card.scss | 249 -----
src/components/card/card.ts | 109 ---
src/components/card/card_spec.ts | 11 -
src/components/content/content.ts | 10 +-
src/components/content/content_spec.ts | 6 +-
src/components/data-table/data_table.ts | 30 +-
.../data-table/data_table_selectable_tr.ts | 3 -
src/components/data-table/data_table_spec.ts | 249 ++---
src/components/dialog/dialog-portal.ts | 2 +-
src/components/dialog/dialog.module.ts | 21 +
src/components/dialog/dialog.ts | 12 +-
src/components/dialog/dialog_spec.ts | 115 ++-
src/components/divider/divider.ts | 10 +-
src/components/divider/divider_spec.ts | 6 +-
src/components/form/messages.scss | 20 -
src/components/form/messages.ts | 124 ---
src/components/form/messages_spec.ts | 106 --
src/components/form/validators.ts | 148 ---
src/components/form/validators_spec.ts | 40 -
src/components/icon/icon.scss | 22 -
src/components/icon/icon.ts | 10 -
src/components/ink/ink.ts | 25 -
src/components/ink/ink_spec.ts | 93 --
src/components/list/list.ts | 69 --
src/components/list/list_spec.ts | 18 -
src/components/pagination/pagination.ts | 94 +-
.../pagination/pagination_controls_spec.ts | 220 +++++
.../pagination_items_per_page_spec.ts | 195 ++++
.../pagination/pagination_range_spec.ts | 199 ++++
.../pagination/pagination_service.ts | 2 +-
src/components/pagination/pagination_spec.ts | 913 ++++--------------
src/components/peekaboo/peekaboo.ts | 8 +-
src/components/peekaboo/peekaboo_spec.ts | 166 ++--
src/components/subheader/subheader.ts | 10 +-
src/components/subheader/subheader_spec.ts | 6 +-
src/components/switch/switch.ts | 76 --
src/components/switch/switch_spec.ts | 115 ---
src/components/whiteframe/whiteframe.scss | 104 --
src/core/style/default-theme.scss | 6 +-
src/core/util/ink_spec.ts | 106 +-
src/core/util/media_spec.ts | 59 +-
src/core/util/util.module.ts | 13 +
src/core/util/viewport.ts | 2 +
src/index.ts | 136 ++-
src/platform/testing/bootstrap.ts | 69 --
src/platform/testing/test_url_resolver.ts | 13 -
src/platform/testing/util.ts | 58 +-
systemjs.config.extras.js | 17 +
systemjs.config.js | 47 +
tsconfig.json | 87 +-
typings.json | 5 +-
131 files changed, 2041 insertions(+), 5109 deletions(-)
create mode 100644 .vscode/settings.json
create mode 100644 karma-test-shim.js
delete mode 100644 karma.ie.shims.js
delete mode 100644 karma.main.js
delete mode 100644 modules/site/e2e/app.e2e.ts
delete mode 100644 modules/site/e2e/app.po.ts
delete mode 100644 modules/site/e2e/tsconfig.json
delete mode 100644 modules/site/e2e/typings.d.ts
delete mode 100644 modules/site/src/app/+components/components.component.spec.ts
delete mode 100644 modules/site/src/app/+index/index.component.spec.ts
delete mode 100644 modules/site/src/app/examples/button/button-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/card/card-action-buttons.component.spec.ts
delete mode 100644 modules/site/src/app/examples/card/card-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/card/card-inline-actions.component.spec.ts
delete mode 100644 modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/data-table/data-table-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/data-table/data-table-selectable-rows.component.spec.ts
delete mode 100644 modules/site/src/app/examples/dialog/dialog-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/elevation/elevation-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/input/input-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/list/list-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/pagination/pagination-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/pagination/pagination-split-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/radio/radio-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/switch/switch-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/examples/tabs/tabs-dynamic-height.component.spec.ts
delete mode 100644 modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.spec.ts
delete mode 100644 modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.spec.ts
delete mode 100644 modules/site/src/app/shared/example/example.component.spec.ts
delete mode 100644 modules/site/src/app/shared/footer/footer.component.spec.ts
delete mode 100644 modules/site/src/app/shared/highlight/highlight-container.component.spec.ts
delete mode 100644 modules/site/src/app/shared/highlight/highlight.component.spec.ts
delete mode 100644 modules/site/src/app/site.component.spec.ts
create mode 100644 src/.baseDir.ts
delete mode 100644 src/components/button/button.scss
delete mode 100644 src/components/button/button.ts
delete mode 100644 src/components/button/button_spec.ts
delete mode 100644 src/components/card/card.scss
delete mode 100644 src/components/card/card.ts
delete mode 100644 src/components/card/card_spec.ts
create mode 100644 src/components/dialog/dialog.module.ts
delete mode 100644 src/components/form/messages.scss
delete mode 100644 src/components/form/messages.ts
delete mode 100644 src/components/form/messages_spec.ts
delete mode 100644 src/components/form/validators.ts
delete mode 100644 src/components/form/validators_spec.ts
delete mode 100644 src/components/icon/icon.scss
delete mode 100644 src/components/icon/icon.ts
delete mode 100644 src/components/ink/ink.ts
delete mode 100644 src/components/ink/ink_spec.ts
delete mode 100644 src/components/list/list.ts
delete mode 100644 src/components/list/list_spec.ts
create mode 100644 src/components/pagination/pagination_controls_spec.ts
create mode 100644 src/components/pagination/pagination_items_per_page_spec.ts
create mode 100644 src/components/pagination/pagination_range_spec.ts
delete mode 100644 src/components/switch/switch.ts
delete mode 100644 src/components/switch/switch_spec.ts
delete mode 100644 src/components/whiteframe/whiteframe.scss
create mode 100644 src/core/util/util.module.ts
delete mode 100644 src/platform/testing/bootstrap.ts
delete mode 100644 src/platform/testing/test_url_resolver.ts
create mode 100644 systemjs.config.extras.js
create mode 100644 systemjs.config.js
diff --git a/.editorconfig b/.editorconfig
index 20380c70..a3fd882b 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -5,7 +5,6 @@ root = true
charset = utf-8
indent_style = space
indent_size = 2
-end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
diff --git a/.travis.yml b/.travis.yml
index 921ae646..678c193b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,11 +17,8 @@ install:
- ./node_modules/.bin/grunt build
script:
-# TODO: When it can be run reliably from travis, add MICROSOFTEDGE_V13.10586
-- karma start karma.sauce.conf.js --browsers IE_V11
-- karma start karma.sauce.conf.js --browsers FIREFOX_V40,FIREFOX_V35
-- karma start karma.sauce.conf.js --browsers CHROME_VBETA,CHROME_VDEV,CHROME_V39,CHROME_V26
-- karma start karma.sauce.conf.js --browsers ANDROID_V5.1,ANDROID_V4.4
+- karma start karma.sauce.conf.js --browsers FIREFOX_VBETA,FIREFOX_VDEV,FIREFOX_V49
+- karma start karma.sauce.conf.js --browsers CHROME_VBETA,CHROME_VDEV,CHROME_V50
after_script:
- ./node_modules/.bin/grunt remapIstanbul
- ./node_modules/.bin/coveralls < .coverage/lcov.info
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..029a5ce5
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,4 @@
+// Place your settings in this file to overwrite default and user settings.
+{
+ "typescript.tsdk": "./node_modules/typescript/lib"
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index 256fade8..69ac60c2 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -79,6 +79,9 @@ module.exports = function (grunt) {
source: {options: {message: 'Source Compiled'}}
},
ts: {
+ options: {
+ compiler: './node_modules/.bin/tsc'
+ },
source: {
tsconfig: true
}
@@ -246,6 +249,7 @@ module.exports = function (grunt) {
});
grunt.registerTask('build-npm', ['build', 'build-npm-package', 'rewrite-source-maps']);
+
grunt.registerTask('build-npm-package', function () {
var fs = require('fs');
var path = require('path');
diff --git a/README.md b/README.md
index f073b03a..293e9604 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,22 @@
ng2-material
---
[![Build Status](https://travis-ci.org/justindujardin/ng2-material.svg?branch=master)](https://travis-ci.org/justindujardin/ng2-material)
-[![Coverage Status](https://coveralls.io/repos/justindujardin/ng2-material/badge.svg?branch=master&service=github)](https://coveralls.io/github/justindujardin/ng2-material?branch=master)
[![npm version](https://badge.fury.io/js/ng2-material.svg)](http://badge.fury.io/js/ng2-material)
-[![Join the chat at https://gitter.im/justindujardin/ng2-material](https://badges.gitter.im/justindujardin/ng2-material.svg)](https://gitter.im/justindujardin/ng2-material?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[![Sauce Test Status](https://saucelabs.com/browser-matrix/ng2material.svg)](https://saucelabs.com/u/ng2material)
-ng2-material is a set of components, built on top of [@angular2-material/core](https://github.com/angular/material2), and a site full of examples of how to use them. The site contains examples for community
-developed components as well as the official material2 components.
+ng2-material is a set of components built on top of [@angular/material](https://github.com/angular/material2).
Check out the [examples site](https://justindujardin.github.io/ng2-material/) for demos and instructions on getting started.
-## Getting Help
+**IMPORTANT**: This project is provided as-is, and no commercial level of support is given to it. If you find an issue and would like to submit a fix, please open a Pull Request with your suggested changes.
+
+**ALSO IMPORTANT** If you are new to Angular2 and in search of a set of material components, please visit [@angular/material](https://github.com/angular/material2) and come back here when you need a component not offered by the official package.
-**IMPORTANT**: This project is provided as-is, and no commercial level of support is given to it. If you need perfect compatbility with IE or great getting started materials for your specific use-case, you may be better off waiting for an official release of material2.
+## Testing
+
+ng2-material components are checked against
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/ng2material.svg)](https://saucelabs.com/u/ng2material)
-That being said, if something is wrong with your installation or with the existing examples or materials, please try to provide a Plunkr example reproducing your problem, and file an issue.
+The tests exercise roughly [![Coverage Status](https://coveralls.io/repos/justindujardin/ng2-material/badge.svg?branch=master&service=github)](https://coveralls.io/github/justindujardin/ng2-material?branch=master) of the code on each browser
## Credits
diff --git a/config.karma.js b/config.karma.js
index 8844ea94..6bdec055 100644
--- a/config.karma.js
+++ b/config.karma.js
@@ -9,16 +9,12 @@ var config = {
'@angular': {
defaultExtension: 'js'
},
- '@angular2-material': {
- defaultExtension: 'js'
- },
'rxjs': {
defaultExtension: 'js'
}
},
map: {
'@angular': '/base/node_modules/@angular',
- '@angular2-material': '/base/node_modules/@angular2-material',
'rxjs': '/base/node_modules/rxjs'
},
baseURL: './base/'
@@ -30,6 +26,7 @@ var packageNames = [
'@angular/compiler',
'@angular/core',
'@angular/http',
+ '@angular/material',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router',
@@ -39,13 +36,6 @@ var packageNames = [
'@angular/upgrade'
];
-var material2Packages = [
- 'core', 'checkbox'
-];
-material2Packages.forEach(function (pkgName) {
- config.packages['@angular2-material/' + pkgName] = {main: pkgName + '.js', defaultExtension: 'js', format: 'cjs'}
-});
-
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
packageNames.forEach(function (pkgName) {
config.packages[pkgName] = {main: 'index.js', defaultExtension: 'js'};
diff --git a/karma-test-shim.js b/karma-test-shim.js
new file mode 100644
index 00000000..6d4aa0e3
--- /dev/null
+++ b/karma-test-shim.js
@@ -0,0 +1,89 @@
+// #docregion
+// /*global jasmine, __karma__, window*/
+Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for app testing.
+
+// Uncomment to get full stacktrace output. Sometimes helpful, usually not.
+// Error.stackTraceLimit = Infinity; //
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
+
+var builtPath = '/base/dist/';
+
+__karma__.loaded = function () { };
+
+function isJsFile(path) {
+ return path.slice(-3) == '.js';
+}
+
+function isSpecFile(path) {
+ return /_spec\.(.*\.)?js$/.test(path);
+}
+
+function isBuiltFile(path) {
+ return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
+}
+
+var allSpecFiles = Object.keys(window.__karma__.files)
+ .filter(isSpecFile)
+ .filter(isBuiltFile);
+
+System.config({
+ baseURL: '/base',
+ // Extend usual application package list with test folder
+ packages: { 'testing': { main: 'index.js', defaultExtension: 'js' } },
+
+ // Assume npm: is set in `paths` in systemjs.config
+ // Map the angular testing umd bundles
+ map: {
+ '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
+ '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
+ '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
+ '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
+ '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
+ '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
+ '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
+ '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
+ },
+});
+
+System.import('systemjs.config.js')
+ .then(importSystemJsExtras)
+ .then(initTestBed)
+ .then(initTesting);
+
+/** Optional SystemJS configuration extras. Keep going w/o it */
+function importSystemJsExtras(){
+ return System.import('systemjs.config.extras.js')
+ .catch(function(reason) {
+ console.log(
+ 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.'
+ );
+ console.log(reason);
+ });
+}
+
+function initTestBed(){
+ return Promise.all([
+ System.import('@angular/core/testing'),
+ System.import('@angular/platform-browser-dynamic/testing')
+ ])
+
+ .then(function (providers) {
+ var coreTesting = providers[0];
+ var browserTesting = providers[1];
+
+ coreTesting.TestBed.initTestEnvironment(
+ browserTesting.BrowserDynamicTestingModule,
+ browserTesting.platformBrowserDynamicTesting());
+ })
+}
+
+// Import all spec files and start karma
+function initTesting () {
+ return Promise.all(
+ allSpecFiles.map(function (moduleName) {
+ return System.import(moduleName);
+ })
+ )
+ .then(__karma__.start, __karma__.error);
+}
diff --git a/karma.conf.js b/karma.conf.js
index f1214ac0..1555878f 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -17,38 +17,39 @@ module.exports = function (config) {
frameworks: ['jasmine'],
files: [
- // Polyfills.
- 'node_modules/core-js/client/shim.min.js',
-
- // System.js for module loading
- // Polyfills.
- 'node_modules/core-js/client/shim.min.js',
-
// System.js for module loading
'node_modules/systemjs/dist/system.src.js',
- // Zone.js dependencies
+ // Polyfills
+ 'node_modules/core-js/client/shim.js',
+ 'node_modules/reflect-metadata/Reflect.js',
+
+ // zone.js
'node_modules/zone.js/dist/zone.js',
+ 'node_modules/zone.js/dist/long-stack-trace-zone.js',
+ 'node_modules/zone.js/dist/proxy.js',
+ 'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
- // RxJs.
+ // RxJs
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
- // paths loaded via module imports
+ // Paths loaded via module imports:
// Angular itself
- { pattern: 'node_modules/@angular/**/*.js', included: false, watched: true },
- { pattern: 'node_modules/@angular2-material/**/*.js', included: false, watched: false },
- 'karma.ie.shims.js',
- "config.karma.js",
+ {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
+ {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
+
+ {pattern: 'systemjs.config.js', included: false, watched: false},
+ {pattern: 'systemjs.config.extras.js', included: false, watched: false},
+
{ pattern: 'dist/*.*', included: false, watched: true },
{ pattern: 'dist/components/**/*.js', included: false, watched: true },
{ pattern: 'dist/core/**/*.js', included: false, watched: true },
- { pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false }, // PhantomJS2 (and possibly others) might require it
{ pattern: 'dist/platform/**/*.js', included: false, watched: true },
- "karma.main.js"
+ "karma-test-shim.js"
],
exclude: [
// Vendor packages might include spec files. We don't want to use those.
diff --git a/karma.ie.shims.js b/karma.ie.shims.js
deleted file mode 100644
index bada337a..00000000
--- a/karma.ie.shims.js
+++ /dev/null
@@ -1,253 +0,0 @@
-// function.name (all IE)
-/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
-if (!Object.hasOwnProperty('name')) {
- Object.defineProperty(Function.prototype, 'name', {
- get: function() {
- var matches = this.toString().match(/^\s*function\s*(\S[^\(]*)\s*\(/);
- var name = matches && matches.length > 1 ? matches[1] : "";
- // For better performance only parse once, and then cache the
- // result through a new accessor for repeated access.
- Object.defineProperty(this, 'name', {value: name});
- return name;
- }
- });
-}
-
-// URL polyfill for SystemJS (all IE)
-/*! @source https://github.com/ModuleLoader/es6-module-loader/blob/master/src/url-polyfill.js*/
-// from https://gist.github.com/Yaffle/1088850
-(function(global) {
- function URLPolyfill(url, baseURL) {
- if (typeof url != 'string') {
- throw new TypeError('URL must be a string');
- }
- var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
- if (!m) {
- throw new RangeError();
- }
- var protocol = m[1] || "";
- var username = m[2] || "";
- var password = m[3] || "";
- var host = m[4] || "";
- var hostname = m[5] || "";
- var port = m[6] || "";
- var pathname = m[7] || "";
- var search = m[8] || "";
- var hash = m[9] || "";
- if (baseURL !== undefined) {
- var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL);
- var flag = protocol === "" && host === "" && username === "";
- if (flag && pathname === "" && search === "") {
- search = base.search;
- }
- if (flag && pathname.charAt(0) !== "/") {
- pathname = (pathname !== "" ? (((base.host !== "" || base.username !== "") && base.pathname === "" ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname);
- }
- // dot segments removal
- var output = [];
- pathname.replace(/^(\.\.?(\/|$))+/, "")
- .replace(/\/(\.(\/|$))+/g, "/")
- .replace(/\/\.\.$/, "/../")
- .replace(/\/?[^\/]*/g, function (p) {
- if (p === "/..") {
- output.pop();
- } else {
- output.push(p);
- }
- });
- pathname = output.join("").replace(/^\//, pathname.charAt(0) === "/" ? "/" : "");
- if (flag) {
- port = base.port;
- hostname = base.hostname;
- host = base.host;
- password = base.password;
- username = base.username;
- }
- if (protocol === "") {
- protocol = base.protocol;
- }
- }
-
- // convert windows file URLs to use /
- if (protocol == 'file:')
- pathname = pathname.replace(/\\/g, '/');
-
- this.origin = protocol + (protocol !== "" || host !== "" ? "//" : "") + host;
- this.href = protocol + (protocol !== "" || host !== "" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash;
- this.protocol = protocol;
- this.username = username;
- this.password = password;
- this.host = host;
- this.hostname = hostname;
- this.port = port;
- this.pathname = pathname;
- this.search = search;
- this.hash = hash;
- }
-global.URLPolyfill = URLPolyfill;
-})(typeof self != 'undefined' ? self : global);
-
-//classList (IE9)
-/*! @license please refer to http://unlicense.org/ */
-/*! @author Eli Grey */
-/*! @source https://github.com/eligrey/classList.js */
-;if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p ie
diff --git a/modules/site/angular-cli-build.js b/modules/site/angular-cli-build.js
index 04ba5e48..d1cbbf17 100644
--- a/modules/site/angular-cli-build.js
+++ b/modules/site/angular-cli-build.js
@@ -19,7 +19,7 @@ module.exports = function(defaults) {
'reflect-metadata/*.js',
'rxjs/**/*.js',
'ng2-material/**/*.*',
- '@angular2-material/**/*.*',
+ '@angular/material/**/*.*',
'@angular/**/*.*'
]
});
diff --git a/modules/site/e2e/app.e2e.ts b/modules/site/e2e/app.e2e.ts
deleted file mode 100644
index e1c6112e..00000000
--- a/modules/site/e2e/app.e2e.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { SitePage } from './app.po';
-
-describe('site App', function() {
- let page: SitePage;
-
- beforeEach(() => {
- page = new SitePage();
- })
-
- it('should display message saying app works', () => {
- page.navigateTo();
- expect(page.getParagraphText()).toEqual('site works!');
- });
-});
diff --git a/modules/site/e2e/app.po.ts b/modules/site/e2e/app.po.ts
deleted file mode 100644
index e017e149..00000000
--- a/modules/site/e2e/app.po.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export class SitePage {
- navigateTo() {
- return browser.get('/');
- }
-
- getParagraphText() {
- return element(by.css('site-app h1')).getText();
- }
-}
diff --git a/modules/site/e2e/tsconfig.json b/modules/site/e2e/tsconfig.json
deleted file mode 100644
index 29de6107..00000000
--- a/modules/site/e2e/tsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "compileOnSave": false,
- "compilerOptions": {
- "declaration": false,
- "emitDecoratorMetadata": true,
- "experimentalDecorators": true,
- "mapRoot": "",
- "module": "commonjs",
- "moduleResolution": "node",
- "noEmitOnError": true,
- "noImplicitAny": false,
- "rootDir": ".",
- "sourceMap": true,
- "sourceRoot": "/",
- "target": "es5"
- }
-}
diff --git a/modules/site/e2e/typings.d.ts b/modules/site/e2e/typings.d.ts
deleted file mode 100644
index 9c2f2d02..00000000
--- a/modules/site/e2e/typings.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-///
diff --git a/modules/site/package.json b/modules/site/package.json
index 54d6c139..3f516530 100644
--- a/modules/site/package.json
+++ b/modules/site/package.json
@@ -21,15 +21,7 @@
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-alpha.8",
- "@angular2-material/checkbox": "2.0.0-alpha.6",
- "@angular2-material/core": "2.0.0-alpha.6",
- "@angular2-material/input": "2.0.0-alpha.6",
- "@angular2-material/progress-bar": "2.0.0-alpha.6",
- "@angular2-material/progress-circle": "2.0.0-alpha.6",
- "@angular2-material/radio": "2.0.0-alpha.6",
- "@angular2-material/sidenav": "2.0.0-alpha.6",
- "@angular2-material/tabs": "^2.0.0-alpha.6",
- "@angular2-material/toolbar": "2.0.0-alpha.6",
+ "@angular/material": "2.0.0-alpha.9",
"es6-shim": "^0.35.0",
"highlightjs": "^8.7.0",
"ng2-material": "file:../../dist",
diff --git a/modules/site/src/app/+components/components.component.spec.ts b/modules/site/src/app/+components/components.component.spec.ts
deleted file mode 100644
index 0f7cd476..00000000
--- a/modules/site/src/app/+components/components.component.spec.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {addProviders, inject} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-
-import {ComponentsComponent} from './components.component';
-
-describe('Component: Components', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ComponentsComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ComponentsComponent], (component: ComponentsComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ComponentsComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ComponentsComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ComponentsComponent]
-})
-class ComponentsComponentTestController {
-}
diff --git a/modules/site/src/app/+index/index.component.html b/modules/site/src/app/+index/index.component.html
index 723cc77b..53a8a241 100644
--- a/modules/site/src/app/+index/index.component.html
+++ b/modules/site/src/app/+index/index.component.html
@@ -34,7 +34,7 @@ Installing from NPM
- npm install --save ng2-material @angular2-material/core
+ npm install --save ng2-material @angular/material
Then import the material directives and providers
diff --git a/modules/site/src/app/+index/index.component.spec.ts b/modules/site/src/app/+index/index.component.spec.ts
deleted file mode 100644
index 640fadd7..00000000
--- a/modules/site/src/app/+index/index.component.spec.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {addProviders, inject} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-
-import {IndexComponent} from './index.component';
-
-describe('Component: Index', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- IndexComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([IndexComponent], (component: IndexComponent) => { expect(component).toBeTruthy(); }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(IndexComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(IndexComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [IndexComponent]
-})
-class IndexComponentTestController {
-}
diff --git a/modules/site/src/app/examples/button/button-basic-usage.component.spec.ts b/modules/site/src/app/examples/button/button-basic-usage.component.spec.ts
deleted file mode 100644
index d0f87d80..00000000
--- a/modules/site/src/app/examples/button/button-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import {addProviders, inject, ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ButtonBasicUsageComponent} from './button-basic-usage.component';
-
-describe('Component: ButtonBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ButtonBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ButtonBasicUsageComponent], (component: ButtonBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ButtonBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ButtonBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ButtonBasicUsageComponent]
-})
-class ButtonBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/card/card-action-buttons.component.spec.ts b/modules/site/src/app/examples/card/card-action-buttons.component.spec.ts
deleted file mode 100644
index 1f6d9c28..00000000
--- a/modules/site/src/app/examples/card/card-action-buttons.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {CardActionButtonsComponent} from './card-action-buttons.component';
-
-describe('Component: CardActionButtons', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- CardActionButtonsComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([CardActionButtonsComponent], (component: CardActionButtonsComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(CardActionButtonsComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(CardActionButtonsComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [CardActionButtonsComponent]
-})
-class CardActionButtonsComponentTestController {
-}
diff --git a/modules/site/src/app/examples/card/card-basic-usage.component.spec.ts b/modules/site/src/app/examples/card/card-basic-usage.component.spec.ts
deleted file mode 100644
index 7eaf1c69..00000000
--- a/modules/site/src/app/examples/card/card-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {CardBasicUsageComponent} from './card-basic-usage.component';
-
-describe('Component: CardBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- CardBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([CardBasicUsageComponent], (component: CardBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(CardBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(CardBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [CardBasicUsageComponent]
-})
-class CardBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/card/card-inline-actions.component.spec.ts b/modules/site/src/app/examples/card/card-inline-actions.component.spec.ts
deleted file mode 100644
index 67a208a6..00000000
--- a/modules/site/src/app/examples/card/card-inline-actions.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {CardInlineActionsComponent} from './card-inline-actions.component';
-
-describe('Component: CardInlineActions', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- CardInlineActionsComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([CardInlineActionsComponent], (component: CardInlineActionsComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(CardInlineActionsComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(CardInlineActionsComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [CardInlineActionsComponent]
-})
-class CardInlineActionsComponentTestController {
-}
diff --git a/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.spec.ts b/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.spec.ts
deleted file mode 100644
index e2c30a19..00000000
--- a/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {CheckboxBasicUsageComponent} from './checkbox-basic-usage.component';
-
-describe('Component: CheckboxBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- CheckboxBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([CheckboxBasicUsageComponent], (component: CheckboxBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(CheckboxBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(CheckboxBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [CheckboxBasicUsageComponent]
-})
-class CheckboxBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.ts b/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.ts
index c3e9955d..578f11bf 100644
--- a/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.ts
+++ b/modules/site/src/app/examples/checkbox/checkbox-basic-usage.component.ts
@@ -1,12 +1,11 @@
import {Component} from '@angular/core';
-import {MdCheckbox} from '@angular2-material/checkbox';
@Component({
moduleId: module.id,
selector: 'checkbox-basic-usage',
templateUrl: 'checkbox-basic-usage.component.html',
styleUrls: ['checkbox-basic-usage.component.css'],
- directives: [MdCheckbox]
+ // directives: [MdCheckbox]
})
export class CheckboxBasicUsageComponent {
public cb1 = true;
diff --git a/modules/site/src/app/examples/checkbox/readme.md b/modules/site/src/app/examples/checkbox/readme.md
index 136497d8..f0499751 100644
--- a/modules/site/src/app/examples/checkbox/readme.md
+++ b/modules/site/src/app/examples/checkbox/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/checkbox` components must be installed for these examples:
+The official `@angular/material/checkbox` components must be installed for these examples:
-View the official documentation: [@angular2-material/checkbox](https://github.com/angular/material2/tree/master/src/components/checkbox)
+View the official documentation: [@angular/material/checkbox](https://github.com/angular/material2/tree/master/src/components/checkbox)
```
-npm install --save @angular2-material/checkbox
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/data-table/data-table-basic-usage.component.spec.ts b/modules/site/src/app/examples/data-table/data-table-basic-usage.component.spec.ts
deleted file mode 100644
index b0a4a190..00000000
--- a/modules/site/src/app/examples/data-table/data-table-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {DataTableBasicUsageComponent} from './data-table-basic-usage.component';
-
-describe('Component: DataTableBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- DataTableBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([DataTableBasicUsageComponent], (component: DataTableBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(DataTableBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(DataTableBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [DataTableBasicUsageComponent]
-})
-class DataTableBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.spec.ts b/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.spec.ts
deleted file mode 100644
index 43ad5ccc..00000000
--- a/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {DataTableSelectableRowsComponent} from './data-table-selectable-rows.component';
-
-describe('Component: DataTableSelectableRows', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- DataTableSelectableRowsComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([DataTableSelectableRowsComponent], (component: DataTableSelectableRowsComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(DataTableSelectableRowsComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(DataTableSelectableRowsComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [DataTableSelectableRowsComponent]
-})
-class DataTableSelectableRowsComponentTestController {
-}
diff --git a/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.ts b/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.ts
index c02c5f28..4455dd72 100644
--- a/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.ts
+++ b/modules/site/src/app/examples/data-table/data-table-selectable-rows.component.ts
@@ -1,13 +1,12 @@
import {Component} from '@angular/core';
-import {MdToolbar} from '@angular2-material/toolbar';
-import {MATERIAL_DIRECTIVES, ITableSelectionChange} from 'ng2-material';
+import {ITableSelectionChange} from 'ng2-material';
@Component({
moduleId: module.id,
selector: 'data-table-selectable-rows',
templateUrl: 'data-table-selectable-rows.component.html',
styleUrls: ['data-table-selectable-rows.component.css'],
- directives: [MATERIAL_DIRECTIVES, MdToolbar]
+ // directives: [MATERIAL_DIRECTIVES, MdToolbar]
})
export class DataTableSelectableRowsComponent {
selection: string;
diff --git a/modules/site/src/app/examples/dialog/dialog-basic-usage.component.spec.ts b/modules/site/src/app/examples/dialog/dialog-basic-usage.component.spec.ts
deleted file mode 100644
index b6b751dd..00000000
--- a/modules/site/src/app/examples/dialog/dialog-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {DialogBasicUsageComponent} from './dialog-basic-usage.component';
-
-describe('Component: DialogBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- DialogBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([DialogBasicUsageComponent], (component: DialogBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(DialogBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(DialogBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [DialogBasicUsageComponent]
-})
-class DialogBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/dialog/dialog-basic-usage.component.ts b/modules/site/src/app/examples/dialog/dialog-basic-usage.component.ts
index dd9ba0aa..6180b74e 100644
--- a/modules/site/src/app/examples/dialog/dialog-basic-usage.component.ts
+++ b/modules/site/src/app/examples/dialog/dialog-basic-usage.component.ts
@@ -1,13 +1,11 @@
import {Component} from '@angular/core';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
-import {OVERLAY_PROVIDERS} from '@angular2-material/core/overlay/overlay';
+import {OVERLAY_PROVIDERS} from '@angular/material';
@Component({
moduleId: module.id,
selector: 'dialog-basic-usage',
templateUrl: 'dialog-basic-usage.component.html',
styleUrls: ['dialog-basic-usage.component.css'],
- directives: [MATERIAL_DIRECTIVES],
providers: [OVERLAY_PROVIDERS]
})
export class DialogBasicUsageComponent {
diff --git a/modules/site/src/app/examples/elevation/elevation-basic-usage.component.spec.ts b/modules/site/src/app/examples/elevation/elevation-basic-usage.component.spec.ts
deleted file mode 100644
index 5f48d8b8..00000000
--- a/modules/site/src/app/examples/elevation/elevation-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ElevationBasicUsageComponent} from './elevation-basic-usage.component';
-
-describe('Component: ElevationBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ElevationBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ElevationBasicUsageComponent], (component: ElevationBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ElevationBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ElevationBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ElevationBasicUsageComponent]
-})
-class ElevationBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/input/input-basic-usage.component.spec.ts b/modules/site/src/app/examples/input/input-basic-usage.component.spec.ts
deleted file mode 100644
index d55cb396..00000000
--- a/modules/site/src/app/examples/input/input-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {InputBasicUsageComponent} from './input-basic-usage.component';
-
-describe('Component: InputBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- InputBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([InputBasicUsageComponent], (component: InputBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(InputBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(InputBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [InputBasicUsageComponent]
-})
-class InputBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/input/input-basic-usage.component.ts b/modules/site/src/app/examples/input/input-basic-usage.component.ts
index df2af2ef..4397a93b 100644
--- a/modules/site/src/app/examples/input/input-basic-usage.component.ts
+++ b/modules/site/src/app/examples/input/input-basic-usage.component.ts
@@ -1,15 +1,11 @@
-import {FORM_DIRECTIVES} from '@angular/forms';
import {Component} from '@angular/core';
-import {MD_INPUT_DIRECTIVES} from '@angular2-material/input';
-import {MdToolbar} from '@angular2-material/toolbar';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
@Component({
moduleId: module.id,
selector: 'input-basic-usage',
templateUrl: 'input-basic-usage.component.html',
styleUrls: ['input-basic-usage.component.css'],
- directives: [MATERIAL_DIRECTIVES, MdToolbar, MD_INPUT_DIRECTIVES, FORM_DIRECTIVES]
+ // directives: [MATERIAL_DIRECTIVES, MdToolbar, MD_INPUT_DIRECTIVES, FORM_DIRECTIVES]
})
export class InputBasicUsageComponent {
user = {
diff --git a/modules/site/src/app/examples/input/readme.md b/modules/site/src/app/examples/input/readme.md
index f1cac7e4..533946e7 100644
--- a/modules/site/src/app/examples/input/readme.md
+++ b/modules/site/src/app/examples/input/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/input` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/input](https://github.com/angular/material2/tree/master/src/components/input)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/input)
```
-npm install --save @angular2-material/input
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/list/list-basic-usage.component.spec.ts b/modules/site/src/app/examples/list/list-basic-usage.component.spec.ts
deleted file mode 100644
index 601494f8..00000000
--- a/modules/site/src/app/examples/list/list-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ListBasicUsageComponent} from './list-basic-usage.component';
-
-describe('Component: ListBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ListBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ListBasicUsageComponent], (component: ListBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ListBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ListBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ListBasicUsageComponent]
-})
-class ListBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/pagination/pagination-basic-usage.component.spec.ts b/modules/site/src/app/examples/pagination/pagination-basic-usage.component.spec.ts
deleted file mode 100644
index b1ee1c39..00000000
--- a/modules/site/src/app/examples/pagination/pagination-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
-import { Component } from '@angular/core';
-import { By } from '@angular/platform-browser';
-import { PaginationBasicUsageComponent } from './pagination-basic-usage.component';
-
-describe('Component: PaginationBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- PaginationBasicUsageComponent,
- ]);
- });
-
- beforeEach(inject([TestComponentBuilder], function (tcb: TestComponentBuilder) {
- builder = tcb;
- }));
-
- it('should inject the component', inject([PaginationBasicUsageComponent],
- (component: PaginationBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(PaginationBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(PaginationBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [PaginationBasicUsageComponent]
-})
-class PaginationBasicUsageComponentTestController {
-}
-
diff --git a/modules/site/src/app/examples/pagination/pagination-split-usage.component.spec.ts b/modules/site/src/app/examples/pagination/pagination-split-usage.component.spec.ts
deleted file mode 100644
index 81e9851e..00000000
--- a/modules/site/src/app/examples/pagination/pagination-split-usage.component.spec.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
-import { Component } from '@angular/core';
-import { By } from '@angular/platform-browser';
-import { PaginationSplitUsageComponent } from './pagination-split-usage.component';
-
-describe('Component: PaginationSplitUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- PaginationSplitUsageComponent,
- ]);
- });
-
- beforeEach(inject([TestComponentBuilder], function (tcb: TestComponentBuilder) {
- builder = tcb;
- }));
-
- it('should inject the component', inject([PaginationSplitUsageComponent],
- (component: PaginationSplitUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(PaginationSplitUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(PaginationSplitUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [PaginationSplitUsageComponent]
-})
-class PaginationSplitUsageComponentTestController {
-}
-
diff --git a/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.spec.ts b/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.spec.ts
deleted file mode 100644
index f6010f29..00000000
--- a/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ProgressBarBasicUsageComponent} from './progress-bar-basic-usage.component';
-
-describe('Component: ProgressBarBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ProgressBarBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ProgressBarBasicUsageComponent], (component: ProgressBarBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ProgressBarBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ProgressBarBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ProgressBarBasicUsageComponent]
-})
-class ProgressBarBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.ts b/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.ts
index 368140df..93d22e3c 100644
--- a/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.ts
+++ b/modules/site/src/app/examples/progress-bar/progress-bar-basic-usage.component.ts
@@ -1,12 +1,11 @@
import {Component} from '@angular/core';
-import {MdProgressBar} from '@angular2-material/progress-bar';
@Component({
moduleId: module.id,
selector: 'progress-bar-basic-usage',
templateUrl: 'progress-bar-basic-usage.component.html',
styleUrls: ['progress-bar-basic-usage.component.css'],
- directives: [MdProgressBar]
+// directives: [MdProgressBar]
})
export class ProgressBarBasicUsageComponent {
public determinateValue: number = 30;
diff --git a/modules/site/src/app/examples/progress-bar/readme.md b/modules/site/src/app/examples/progress-bar/readme.md
index 43f467e2..62e0c4bc 100644
--- a/modules/site/src/app/examples/progress-bar/readme.md
+++ b/modules/site/src/app/examples/progress-bar/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/progress-bar` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/progress-bar](https://github.com/angular/material2/tree/master/src/components/progress-bar)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/progress-bar)
```
-npm install --save @angular2-material/progress-bar
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.spec.ts b/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.spec.ts
deleted file mode 100644
index f433f523..00000000
--- a/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ProgressCircleBasicUsageComponent} from './progress-circle-basic-usage.component';
-
-describe('Component: ProgressCircleBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ProgressCircleBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ProgressCircleBasicUsageComponent], (component: ProgressCircleBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ProgressCircleBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query =
- fixture.debugElement.query(By.directive(ProgressCircleBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ProgressCircleBasicUsageComponent]
-})
-class ProgressCircleBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.ts b/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.ts
index b7f13f7e..438a76d3 100644
--- a/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.ts
+++ b/modules/site/src/app/examples/progress-circle/progress-circle-basic-usage.component.ts
@@ -1,5 +1,5 @@
import {Component, OnInit} from '@angular/core';
-import {MdProgressCircle} from '@angular2-material/progress-circle';
+import {MdProgressCircle} from '@angular/material';
@Component({
moduleId: module.id,
selector: 'progress-circle-basic-usage',
diff --git a/modules/site/src/app/examples/progress-circle/readme.md b/modules/site/src/app/examples/progress-circle/readme.md
index 6d0864f2..41464a3f 100644
--- a/modules/site/src/app/examples/progress-circle/readme.md
+++ b/modules/site/src/app/examples/progress-circle/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/progress-circle` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/progress-circle](https://github.com/angular/material2/tree/master/src/components/progress-circle)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/progress-circle)
```
-npm install --save @angular2-material/progress-circle
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/radio/radio-basic-usage.component.spec.ts b/modules/site/src/app/examples/radio/radio-basic-usage.component.spec.ts
deleted file mode 100644
index 86dd42a2..00000000
--- a/modules/site/src/app/examples/radio/radio-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {RadioBasicUsageComponent} from './radio-basic-usage.component';
-
-describe('Component: RadioBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- RadioBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([RadioBasicUsageComponent], (component: RadioBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(RadioBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(RadioBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [RadioBasicUsageComponent]
-})
-class RadioBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/radio/radio-basic-usage.component.ts b/modules/site/src/app/examples/radio/radio-basic-usage.component.ts
index 0d26fe12..2969b3e8 100644
--- a/modules/site/src/app/examples/radio/radio-basic-usage.component.ts
+++ b/modules/site/src/app/examples/radio/radio-basic-usage.component.ts
@@ -1,13 +1,12 @@
import {Component} from '@angular/core';
-import {MdUniqueSelectionDispatcher} from '@angular2-material/core';
-import {MD_RADIO_DIRECTIVES} from '@angular2-material/radio';
+import {MdUniqueSelectionDispatcher} from '@angular/material';
@Component({
moduleId: module.id,
selector: 'radio-basic-usage',
templateUrl: 'radio-basic-usage.component.html',
styleUrls: ['radio-basic-usage.component.css'],
- directives: [MD_RADIO_DIRECTIVES],
+ // directives: [MD_RADIO_DIRECTIVES],
providers: [MdUniqueSelectionDispatcher]
})
export class RadioBasicUsageComponent {
diff --git a/modules/site/src/app/examples/radio/readme.md b/modules/site/src/app/examples/radio/readme.md
index 7830de98..4270cafe 100644
--- a/modules/site/src/app/examples/radio/readme.md
+++ b/modules/site/src/app/examples/radio/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/input` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/radio](https://github.com/angular/material2/tree/master/src/components/radio)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/radio)
```
-npm install --save @angular2-material/radio
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/sidenav/readme.md b/modules/site/src/app/examples/sidenav/readme.md
index 572f22c5..bd46e7cc 100644
--- a/modules/site/src/app/examples/sidenav/readme.md
+++ b/modules/site/src/app/examples/sidenav/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/sidenav` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/sidenav](https://github.com/angular/material2/tree/master/src/components/sidenav)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/sidenav)
```
-npm install --save @angular2-material/sidenav
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.spec.ts b/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.spec.ts
deleted file mode 100644
index bbf7eb57..00000000
--- a/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {SidenavBasicUsageComponent} from './sidenav-basic-usage.component';
-
-describe('Component: SidenavBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- SidenavBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([SidenavBasicUsageComponent], (component: SidenavBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(SidenavBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(SidenavBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [SidenavBasicUsageComponent]
-})
-class SidenavBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.ts b/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.ts
index cacdf1a2..0f981e1f 100644
--- a/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.ts
+++ b/modules/site/src/app/examples/sidenav/sidenav-basic-usage.component.ts
@@ -1,12 +1,11 @@
import {Component} from '@angular/core';
-import {MD_SIDENAV_DIRECTIVES} from '@angular2-material/sidenav';
@Component({
moduleId: module.id,
selector: 'sidenav-basic-usage',
templateUrl: 'sidenav-basic-usage.component.html',
styleUrls: ['sidenav-basic-usage.component.css'],
- directives: [MD_SIDENAV_DIRECTIVES]
+ // directives: [MD_SIDENAV_DIRECTIVES]
})
export class SidenavBasicUsageComponent {
}
diff --git a/modules/site/src/app/examples/switch/switch-basic-usage.component.spec.ts b/modules/site/src/app/examples/switch/switch-basic-usage.component.spec.ts
deleted file mode 100644
index 77c6dee0..00000000
--- a/modules/site/src/app/examples/switch/switch-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {SwitchBasicUsageComponent} from './switch-basic-usage.component';
-
-describe('Component: SwitchBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- SwitchBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([SwitchBasicUsageComponent], (component: SwitchBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(SwitchBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(SwitchBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [SwitchBasicUsageComponent]
-})
-class SwitchBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/tabs/readme.md b/modules/site/src/app/examples/tabs/readme.md
index a941ca9a..8f69aa7c 100644
--- a/modules/site/src/app/examples/tabs/readme.md
+++ b/modules/site/src/app/examples/tabs/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/tabs` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/tabs](https://github.com/angular/material2/tree/master/src/components/tabs)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/tabs)
```
-npm install --save @angular2-material/tabs
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.spec.ts b/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.spec.ts
deleted file mode 100644
index a8203db9..00000000
--- a/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {TabsDynamicHeightComponent} from './tabs-dynamic-height.component';
-
-describe('Component: TabsDynamicHeight', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- TabsDynamicHeightComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([TabsDynamicHeightComponent], (component: TabsDynamicHeightComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(TabsDynamicHeightComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(TabsDynamicHeightComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [TabsDynamicHeightComponent]
-})
-class TabsDynamicHeightComponentTestController {
-}
diff --git a/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.ts b/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.ts
index 85fd04b3..ec76b43a 100644
--- a/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.ts
+++ b/modules/site/src/app/examples/tabs/tabs-dynamic-height.component.ts
@@ -1,13 +1,11 @@
import {Component, ViewEncapsulation} from '@angular/core';
-import {MD_TABS_DIRECTIVES} from '@angular2-material/tabs';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
@Component({
moduleId: module.id,
selector: 'tabs-dynamic-height',
templateUrl: 'tabs-dynamic-height.component.html',
styleUrls: ['tabs-dynamic-height.component.css'],
- directives: [MATERIAL_DIRECTIVES, MD_TABS_DIRECTIVES],
+ // directives: [MATERIAL_DIRECTIVES, MD_TABS_DIRECTIVES],
encapsulation: ViewEncapsulation.None
})
export class TabsDynamicHeightComponent {
diff --git a/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.spec.ts b/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.spec.ts
deleted file mode 100644
index b6b68bec..00000000
--- a/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {TabsDynamicTabsComponent} from './tabs-dynamic-tabs.component';
-
-describe('Component: TabsDynamicTabs', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- TabsDynamicTabsComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([TabsDynamicTabsComponent], (component: TabsDynamicTabsComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(TabsDynamicTabsComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(TabsDynamicTabsComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [TabsDynamicTabsComponent]
-})
-class TabsDynamicTabsComponentTestController {
-}
diff --git a/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.ts b/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.ts
index 20f39601..477150bd 100644
--- a/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.ts
+++ b/modules/site/src/app/examples/tabs/tabs-dynamic-tabs.component.ts
@@ -1,7 +1,4 @@
import {Component, ViewEncapsulation, Input} from '@angular/core';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
-import {MD_TABS_DIRECTIVES} from '@angular2-material/tabs';
-import {MD_INPUT_DIRECTIVES} from '@angular2-material/input';
export interface ITabData {
title: string;
@@ -15,7 +12,7 @@ export interface ITabData {
templateUrl: 'tabs-dynamic-tabs.component.html',
styleUrls: ['tabs-dynamic-tabs.component.css'],
encapsulation: ViewEncapsulation.None,
- directives: [MATERIAL_DIRECTIVES, MD_TABS_DIRECTIVES, MD_INPUT_DIRECTIVES]
+ // directives: [MATERIAL_DIRECTIVES, MD_TABS_DIRECTIVES, MD_INPUT_DIRECTIVES]
})
export class TabsDynamicTabsComponent {
public tabs: ITabData[] = [
diff --git a/modules/site/src/app/examples/toolbar/readme.md b/modules/site/src/app/examples/toolbar/readme.md
index 9c204218..2d595e7b 100644
--- a/modules/site/src/app/examples/toolbar/readme.md
+++ b/modules/site/src/app/examples/toolbar/readme.md
@@ -1,9 +1,9 @@
# [](https://material.angular.io)
-The official `@angular2-material/toolbar` components must be installed for these examples:
+The official `@angular/material` components must be installed for these examples:
-View the official documentation: [@angular2-material/toolbar](https://github.com/angular/material2/tree/master/src/components/toolbar)
+View the official documentation: [@angular/material](https://github.com/angular/material2/tree/master/src/components/toolbar)
```
-npm install --save @angular2-material/toolbar
+npm install --save @angular/material
```
diff --git a/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.spec.ts b/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.spec.ts
deleted file mode 100644
index 9ab03f3d..00000000
--- a/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ToolbarBasicUsageComponent} from './toolbar-basic-usage.component';
-
-describe('Component: ToolbarBasicUsage', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ToolbarBasicUsageComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([ToolbarBasicUsageComponent], (component: ToolbarBasicUsageComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ToolbarBasicUsageComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ToolbarBasicUsageComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ToolbarBasicUsageComponent]
-})
-class ToolbarBasicUsageComponentTestController {
-}
diff --git a/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.ts b/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.ts
index 5e4ee030..a3999729 100644
--- a/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.ts
+++ b/modules/site/src/app/examples/toolbar/toolbar-basic-usage.component.ts
@@ -1,13 +1,11 @@
import {Component} from '@angular/core';
-import {MdToolbar} from '@angular2-material/toolbar';
-import {MdIcon} from 'ng2-material';
@Component({
moduleId: module.id,
selector: 'toolbar-basic-usage',
templateUrl: 'toolbar-basic-usage.component.html',
styleUrls: ['toolbar-basic-usage.component.css'],
- directives: [MdToolbar, MdIcon]
+ // directives: [MdToolbar, MdIcon]
})
export class ToolbarBasicUsageComponent {
}
diff --git a/modules/site/src/app/shared/example/example.component.spec.ts b/modules/site/src/app/shared/example/example.component.spec.ts
deleted file mode 100644
index ce5f4d89..00000000
--- a/modules/site/src/app/shared/example/example.component.spec.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {ExampleComponent} from './example.component';
-
-describe('Component: Example', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- ExampleComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component', inject([ExampleComponent], (component: ExampleComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(ExampleComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(ExampleComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [ExampleComponent]
-})
-class ExampleComponentTestController {
-}
diff --git a/modules/site/src/app/shared/example/example.component.ts b/modules/site/src/app/shared/example/example.component.ts
index e8f013f3..f33b2789 100644
--- a/modules/site/src/app/shared/example/example.component.ts
+++ b/modules/site/src/app/shared/example/example.component.ts
@@ -8,9 +8,6 @@ import {
ComponentResolver
} from '@angular/core';
import {Http} from '@angular/http';
-import {MdToolbar} from '@angular2-material/toolbar';
-import {MD_TABS_DIRECTIVES} from '@angular2-material/tabs';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
import {IExampleData, DEMO_DIRECTIVES} from '../../index';
import {HighlightComponent} from '../highlight/highlight.component';
@@ -24,7 +21,7 @@ export interface ISourceFile {
selector: 'docs-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
- directives: [MATERIAL_DIRECTIVES, MD_TABS_DIRECTIVES, HighlightComponent, MdToolbar]
+ // directives: [HighlightComponent]
})
export class ExampleComponent implements AfterViewInit {
private _model: IExampleData = null;
@@ -98,7 +95,7 @@ export class ExampleComponent implements AfterViewInit {
@Component({
selector: `md-example-${model.component}`,
template: template,
- directives: [MATERIAL_DIRECTIVES, DEMO_DIRECTIVES, HighlightComponent]
+ // directives: [MATERIAL_DIRECTIVES, DEMO_DIRECTIVES, HighlightComponent]
})
class CompiledComponent {
}
diff --git a/modules/site/src/app/shared/footer/footer.component.spec.ts b/modules/site/src/app/shared/footer/footer.component.spec.ts
deleted file mode 100644
index 0cb22aaf..00000000
--- a/modules/site/src/app/shared/footer/footer.component.spec.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {FooterComponent} from './footer.component';
-
-describe('Component: Footer', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- FooterComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component', inject([FooterComponent], (component: FooterComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(FooterComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(FooterComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [FooterComponent]
-})
-class FooterComponentTestController {
-}
diff --git a/modules/site/src/app/shared/footer/footer.component.ts b/modules/site/src/app/shared/footer/footer.component.ts
index 17b48f14..086f796f 100644
--- a/modules/site/src/app/shared/footer/footer.component.ts
+++ b/modules/site/src/app/shared/footer/footer.component.ts
@@ -1,7 +1,5 @@
import {Component, OnInit} from '@angular/core';
-import {ROUTER_DIRECTIVES} from '@angular/router';
-import {MdToolbar} from '@angular2-material/toolbar';
-import {MATERIAL_DIRECTIVES} from 'ng2-material';
+
import {NavigationService} from '../navigation.service';
@@ -10,7 +8,7 @@ import {NavigationService} from '../navigation.service';
selector: 'docs-footer',
templateUrl: 'footer.component.html',
styleUrls: ['footer.component.css'],
- directives: [ROUTER_DIRECTIVES, MdToolbar, MATERIAL_DIRECTIVES]
+ // directives: [ROUTER_DIRECTIVES, MdToolbar, MATERIAL_DIRECTIVES]
})
export class FooterComponent implements OnInit {
constructor(private navigation: NavigationService) {}
diff --git a/modules/site/src/app/shared/highlight/highlight-container.component.spec.ts b/modules/site/src/app/shared/highlight/highlight-container.component.spec.ts
deleted file mode 100644
index a6531e07..00000000
--- a/modules/site/src/app/shared/highlight/highlight-container.component.spec.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {HighlightContainerComponent} from './highlight-container.component.ts';
-
-describe('Component: HighlightContainer', () => {
- let builder: TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- HighlightContainerComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function(tcb: TestComponentBuilder) { builder = tcb; }));
-
- it('should inject the component',
- inject([HighlightContainerComponent], (component: HighlightContainerComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(HighlightContainerComponentTestController)
- .then((fixture: ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(HighlightContainerComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [HighlightContainerComponent]
-})
-class HighlightContainerComponentTestController {
-}
diff --git a/modules/site/src/app/shared/highlight/highlight.component.spec.ts b/modules/site/src/app/shared/highlight/highlight.component.spec.ts
deleted file mode 100644
index 67ea7da4..00000000
--- a/modules/site/src/app/shared/highlight/highlight.component.spec.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
-import {Component} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {HighlightComponent} from './highlight.component';
-
-describe('Component: Highlight', () => {
- let builder:TestComponentBuilder;
-
- beforeEach(() => {
- addProviders([
- HighlightComponent,
- ]);
- });
-
- beforeEach(
- inject([TestComponentBuilder], function (tcb:TestComponentBuilder) {
- builder = tcb;
- })
- );
-
- it('should inject the component',
- inject([HighlightComponent], (component:HighlightComponent) => {
- expect(component).toBeTruthy();
- }));
-
- it('should create the component', inject([], () => {
- return builder.createAsync(HighlightComponentTestController)
- .then((fixture:ComponentFixture) => {
- let query = fixture.debugElement.query(By.directive(HighlightComponent));
- expect(query).toBeTruthy();
- expect(query.componentInstance).toBeTruthy();
- });
- }));
-});
-
-@Component({
- selector: 'test',
- template: `
-
- `,
- directives: [HighlightComponent]
-})
-class HighlightComponentTestController {
-}
diff --git a/modules/site/src/app/site.component.spec.ts b/modules/site/src/app/site.component.spec.ts
deleted file mode 100644
index eff53cdf..00000000
--- a/modules/site/src/app/site.component.spec.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {addProviders, inject} from '@angular/core/testing';
-import {SiteAppComponent} from '../app/site.component';
-
-beforeEach(() => {
- addProviders([
- SiteAppComponent,
- ]);
-});
-
-describe('App: Site', () => {
- it('should create the app',
- inject([SiteAppComponent], (app: SiteAppComponent) => { expect(app).toBeTruthy(); }));
-
- it('should have a name', inject([SiteAppComponent], (app: SiteAppComponent) => {
- expect(app.site).toEqual('Angular2 Material');
- }));
-});
diff --git a/modules/site/src/app/site.component.ts b/modules/site/src/app/site.component.ts
index b850e3dc..a6b388d5 100644
--- a/modules/site/src/app/site.component.ts
+++ b/modules/site/src/app/site.component.ts
@@ -1,9 +1,8 @@
import { Component, OnInit, OnDestroy, Input, ViewChild, AfterViewInit } from '@angular/core';
import { Response, Http } from '@angular/http';
-import { ROUTER_DIRECTIVES, provideRouter, Router, RouterConfig } from '@angular/router';
-import { MD_SIDENAV_DIRECTIVES, MdSidenav } from '@angular2-material/sidenav';
-import { MdToolbar } from '@angular2-material/toolbar';
-import { MATERIAL_DIRECTIVES, Media, MdIcon } from 'ng2-material';
+import { provideRouter, Router, RouterConfig } from '@angular/router';
+import { MdSidenav } from '@angular/material';
+import { Media } from 'ng2-material';
import { ComponentsComponent } from './+components';
import { IndexComponent } from './+index';
import { ComponentsService, IComponentMeta } from './shared/components.service';
@@ -27,10 +26,10 @@ export const AppRouterProviders = [
templateUrl: 'site.component.html',
styleUrls: ['site.component.css'],
pipes: [ComponentsOrderByPipe],
- directives: [
- ROUTER_DIRECTIVES, MATERIAL_DIRECTIVES, MD_SIDENAV_DIRECTIVES, MdIcon, MdToolbar,
- FooterComponent
- ]
+ // directives: [
+ // ROUTER_DIRECTIVES, MATERIAL_DIRECTIVES, MD_SIDENAV_DIRECTIVES, MdIcon, MdToolbar,
+ // FooterComponent
+ // ]
})
export class SiteAppComponent implements OnInit,
OnDestroy, AfterViewInit {
diff --git a/modules/site/src/system-config.ts b/modules/site/src/system-config.ts
index 4682be1f..2b665778 100644
--- a/modules/site/src/system-config.ts
+++ b/modules/site/src/system-config.ts
@@ -14,7 +14,7 @@ const packages: any = {};
const barrels: string[] = [
// Angular specific barrels.
'@angular/core', '@angular/common', '@angular/forms', '@angular/compiler', '@angular/http', '@angular/router',
- '@angular/platform-browser', '@angular/platform-browser-dynamic',
+ '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/material'
// Thirdparty barrels.
'rxjs', 'ng2-material',
@@ -30,17 +30,6 @@ const barrels: string[] = [
const cliSystemConfigPackages: any = {};
barrels.forEach((barrelName: string) => { cliSystemConfigPackages[barrelName] = {main: 'index'}; });
-// Material2 specific barrels.
-['core', 'checkbox', 'progress-circle', 'progress-bar', 'radio', 'toolbar', 'sidenav', 'icon',
- 'input', 'tabs'
-
-].forEach((pkgName: string) => {
- cliSystemConfigPackages['@angular2-material/' + pkgName] = {
- main: pkgName + '.js',
- defaultExtension: 'js',
- format: 'cjs'
- };
-});
/** Type declaration for ambient System. */
declare var System: any;
@@ -49,7 +38,6 @@ declare var System: any;
System.config({
map: {
'@angular': 'vendor/@angular',
- '@angular2-material': 'vendor/@angular2-material',
'ng2-material': 'vendor/ng2-material',
'rxjs': 'vendor/rxjs',
'main': 'main.js'
diff --git a/modules/webpack/package.json b/modules/webpack/package.json
index 9d2cff88..2b9d4a4a 100644
--- a/modules/webpack/package.json
+++ b/modules/webpack/package.json
@@ -13,8 +13,7 @@
"@angular/compiler": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
- "@angular2-material/core": "2.0.0-alpha.6-2",
- "@angular2-material/toolbar": "2.0.0-alpha.6-2",
+ "@angular/material": "^2.0.0-alpha.9",
"es6-shim": "^0.35.0",
"ng2-material": "*",
"reflect-metadata": "^0.1.3",
diff --git a/modules/webpack/src/main.ts b/modules/webpack/src/main.ts
index ad1c422a..5c808ed8 100755
--- a/modules/webpack/src/main.ts
+++ b/modules/webpack/src/main.ts
@@ -5,20 +5,19 @@ require('zone.js/dist/zone');
import '@angular/core';
import '@angular/common';
-import '@angular2-material/core';
+import '@angular/material';
import {Component} from '@angular/core';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {MATERIAL_BROWSER_PROVIDERS, MATERIAL_DIRECTIVES} from 'ng2-material';
-import {MdToolbar} from '@angular2-material/toolbar';
import 'ng2-material/ng2-material.css';
import 'ng2-material/font/font.css';
@Component({
selector: 'my-app',
- directives: [MATERIAL_DIRECTIVES, MdToolbar],
+ // directives: [MATERIAL_DIRECTIVES, MdToolbar],
template: `
ng2-material, material2, and webpack
@@ -106,11 +105,11 @@ import 'ng2-material/font/font.css';
margin-bottom: 16px;
}
}
-
+
md-content {
margin-right: 7px;
}
-
+
.label {
position: absolute;
bottom: 5px;
diff --git a/ng2-material.d.ts b/ng2-material.d.ts
index 1ede4780..cba18435 100644
--- a/ng2-material.d.ts
+++ b/ng2-material.d.ts
@@ -1,2 +1 @@
-///
export * from './src/index';
diff --git a/package.json b/package.json
index c6c3e883..cbe13605 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ng2-material",
- "version": "0.6.1",
+ "version": "0.7.0-4",
"description": "",
"main": "./index.js",
"repository": {
@@ -13,69 +13,74 @@
"scripts": {
"tdd": "./node_modules/.bin/grunt tdd",
"start": "./node_modules/.bin/grunt serve",
- "test": "./node_modules/.bin/grunt karma",
- "postinstall": "./node_modules/.bin/typings install"
+ "test": "./node_modules/.bin/grunt karma"
},
"dependencies": {
- "@angular/common": "2.0.0-rc.4",
- "@angular/compiler": "2.0.0-rc.4",
- "@angular/core": "2.0.0-rc.4",
- "@angular/forms": "^0.2.0",
- "@angular/platform-browser": "2.0.0-rc.4",
- "@angular/platform-browser-dynamic": "2.0.0-rc.4",
- "@angular/router": "3.0.0-beta.2",
- "@angular2-material/checkbox": "2.0.0-alpha.6",
- "@angular2-material/core": "2.0.0-alpha.6",
- "es6-promise": ">=3.0.2",
- "es6-shim": "^0.35.0",
- "grunt-sass": "^1.2.0",
- "reflect-metadata": "^0.1.3",
- "rxjs": "5.0.0-beta.6",
- "zone.js": "^0.6.12"
+ "@angular/common": "^2.0.0",
+ "@angular/compiler": "^2.0.0",
+ "@angular/core": "^2.0.0",
+ "@angular/forms": "^2.0.0",
+ "@angular/http": "^2.0.0",
+ "@angular/material": "^2.0.0-alpha.9",
+ "@angular/platform-browser": "^2.0.0",
+ "@angular/platform-browser-dynamic": "^2.0.0",
+ "@angular/router": "^3.0.0",
+ "es6-promise": ">=3.3.1",
+ "es6-shim": "^0.35.1",
+ "grunt-sass": "^1.2.1",
+ "reflect-metadata": "^0.1.8",
+ "rxjs": "^5.0.0-beta.12",
+ "zone.js": "^0.6.23"
},
"typings": "./index.d.ts",
"devDependencies": {
- "autoprefixer": "6.2.0",
- "codelyzer": "0.0.19",
- "core-js": "^2.4.0",
- "coveralls": "2.11.6",
+ "@types/core-js": "^0.9.34",
+ "@types/hammerjs": "^2.0.32",
+ "@types/jasmine": "^2.2.33",
+ "@types/node": "^6.0.38",
+ "autoprefixer": "6.5.0",
+ "codelyzer": "1.0.0-beta.0",
+ "core-js": "^2.4.1",
+ "coveralls": "2.11.14",
"css": "^2.2.1",
- "css-loader": "0.23.1",
- "es6-module-loader": "0.17.4",
- "file-loader": "0.8.5",
- "glob": "6.0.1",
- "grunt": "0.4.5",
- "grunt-bump": "0.7.0",
- "grunt-cli": "0.1.13",
+ "css-loader": "0.25.0",
+ "es6-module-loader": "0.17.11",
+ "file-loader": "0.9.0",
+ "glob": "7.1.0",
+ "grunt": "1.0.1",
+ "grunt-bump": "0.8.0",
+ "grunt-cli": "1.2.0",
"grunt-continue": "^0.1.0",
- "grunt-contrib-clean": "0.7.0",
- "grunt-contrib-connect": "0.11.2",
- "grunt-contrib-copy": "0.8.2",
- "grunt-contrib-sass": "0.9.2",
- "grunt-contrib-watch": "0.6.1",
- "grunt-conventional-changelog": "5.0.0",
- "grunt-karma": "0.12.1",
- "grunt-notify": "0.4.3",
+ "grunt-contrib-clean": "1.0.0",
+ "grunt-contrib-connect": "1.0.2",
+ "grunt-contrib-copy": "1.0.0",
+ "grunt-contrib-sass": "1.0.0",
+ "grunt-contrib-watch": "1.0.0",
+ "grunt-conventional-changelog": "6.1.0",
+ "grunt-karma": "2.0.0",
+ "grunt-notify": "0.4.5",
"grunt-npm": "0.0.2",
- "grunt-postcss": "0.7.1",
- "grunt-ts": "5.2.0",
+ "grunt-postcss": "0.8.0",
+ "grunt-ts": "6.0.0-beta.3",
"highlightjs": "8.7.0",
"istanbul": "1.0.0-alpha.2",
- "karma": "0.13.19",
- "karma-chrome-launcher": "0.2.2",
- "karma-coverage": "0.5.3",
- "karma-firefox-launcher": "0.1.7",
- "karma-jasmine": "0.2.2",
- "karma-mocha-reporter": "1.1.5",
- "karma-sauce-launcher": "0.3.0",
+ "jasmine-core": "^2.5.2",
+ "karma": "^1.3.0",
+ "karma-chrome-launcher": "2.0.0",
+ "karma-coverage": "1.1.1",
+ "karma-firefox-launcher": "1.0.0",
+ "karma-jasmine": "1.0.2",
+ "karma-mocha-reporter": "2.2.0",
+ "karma-sauce-launcher": "1.0.0",
"lcov-parse": "0.0.10",
- "marked": "0.3.5",
- "npm": "^3.9.2",
- "remap-istanbul": "0.4.0",
- "style-loader": "0.13.0",
- "systemjs": "0.19.27",
- "typescript": ">=1.8.9",
- "typings": "^1.0.4",
+ "marked": "0.3.6",
+ "npm": "^3.10.7",
+ "remap-istanbul": "0.6.4",
+ "style-loader": "0.13.1",
+ "systemjs": "0.19.39",
+ "tslint": "^3.15.1",
+ "typescript": "^2.0.0",
+ "typings": "^1.3.3",
"underscore": "1.8.3"
},
"contributors": [
diff --git a/src/.baseDir.ts b/src/.baseDir.ts
new file mode 100644
index 00000000..ec32b31e
--- /dev/null
+++ b/src/.baseDir.ts
@@ -0,0 +1 @@
+// Ignore this file. See https://github.com/grunt-ts/grunt-ts/issues/77
\ No newline at end of file
diff --git a/src/components.scss b/src/components.scss
index a4be72e6..47525ba2 100644
--- a/src/components.scss
+++ b/src/components.scss
@@ -1,15 +1,10 @@
@import "components/backdrop/backdrop";
-@import "components/button/button";
-@import "components/card/card";
@import "components/content/content";
@import "components/data-table/data_table";
@import "components/dialog/dialog";
@import "components/divider/divider";
-@import "components/icon/icon";
@import "components/list/list";
-@import "components/form/messages";
@import "components/pagination/pagination";
@import "components/peekaboo/peekaboo";
@import "components/subheader/subheader";
@import "components/switch/switch";
-@import "components/whiteframe/whiteframe";
diff --git a/src/components/backdrop/backdrop.ts b/src/components/backdrop/backdrop.ts
index 46911c75..896cf9f8 100644
--- a/src/components/backdrop/backdrop.ts
+++ b/src/components/backdrop/backdrop.ts
@@ -1,6 +1,8 @@
-import {Animate} from "../../core/util/animate";
-import {ElementRef, ViewEncapsulation, Component, Input, Output, EventEmitter} from "@angular/core";
-import {ViewportHelper} from "../../core/util/viewport";
+import {Animate} from '../../core/util/animate';
+import {ElementRef, ViewEncapsulation, Component, Input, Output, EventEmitter, NgModule} from '@angular/core';
+import {ViewportHelper} from '../../core/util/viewport';
+import {MATERIAL_BROWSER_PROVIDERS} from '../../index';
+import {MdServicesModule} from '../../core/util/util.module';
/**
* An overlay for content on the page.
@@ -152,3 +154,11 @@ export class MdBackdrop {
});
}
}
+
+@NgModule({
+ declarations: [MdBackdrop],
+ exports: [MdBackdrop],
+ imports: [MdServicesModule]
+})
+export class MdBackdropModule {
+}
diff --git a/src/components/backdrop/backdrop_spec.ts b/src/components/backdrop/backdrop_spec.ts
index 248e4f89..831d703f 100644
--- a/src/components/backdrop/backdrop_spec.ts
+++ b/src/components/backdrop/backdrop_spec.ts
@@ -1,229 +1,219 @@
-import {inject, async} from "@angular/core/testing";
-import {ComponentFixture, TestComponentBuilder} from "@angular/core/testing";
-import {Component, DebugElement} from "@angular/core";
-import {MdBackdrop} from "../../index";
-import {By} from "@angular/platform-browser";
-import {promiseWait} from "../../platform/testing/util";
-
-export function main() {
-
- interface IBackdropFixture {
- fixture: ComponentFixture;
- debug: DebugElement;
- backdrop: MdBackdrop;
- }
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {DebugElement} from '@angular/core';
+import {By} from '@angular/platform-browser';
+import {promiseWait} from '../../platform/testing/util';
+import {MdBackdrop} from './backdrop';
+import {MdServicesModule} from '../../core/util/util.module';
+
+interface IBackdropFixture {
+ fixture: ComponentFixture;
+ debug: DebugElement;
+ backdrop: MdBackdrop;
+}
+
+describe('Backdrop', () => {
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ declarations: [MdBackdrop],
+ imports: [MdServicesModule],
+ providers: []
+ });
+ });
- @Component({
- selector: 'test-app',
- directives: [MdBackdrop],
- template: ``
- })
- class TestComponent {
+ function setup(show: boolean = false, transitionAddClass: boolean = true): Promise {
+ let result: IBackdropFixture = null;
+ return TestBed.compileComponents()
+ .then(() => {
+ const fixture = TestBed.createComponent(MdBackdrop);
+ const debug: DebugElement = fixture.debugElement;
+ const backdrop = fixture.componentInstance as MdBackdrop;
+ backdrop.transitionAddClass = transitionAddClass;
+ fixture.detectChanges();
+ result = {
+ fixture: fixture,
+ debug: debug,
+ backdrop: backdrop
+ };
+ if (show) {
+ return backdrop.show();
+ }
+ })
+ .then(() => result)
+ .catch(error => console.error.bind(console));
}
- describe('Backdrop', () => {
- let builder: TestComponentBuilder;
-
- function setup(show: boolean = false, transitionAddClass: boolean = true): Promise {
- let result: IBackdropFixture = null;
- return promiseWait()
- .then(() => builder.createAsync(TestComponent))
- .then((fixture: ComponentFixture) => {
- let debug: DebugElement = fixture.debugElement.query(By.css('md-backdrop'));
- let backdrop = debug.componentInstance;
- backdrop.transitionAddClass = transitionAddClass;
- fixture.detectChanges();
- result = {
- fixture: fixture,
- debug: debug,
- backdrop: backdrop
- };
- if (show) {
- return backdrop.show();
- }
- })
- .then(() => result)
- .catch(error => console.error.bind(console));
- }
-
- beforeEach(inject([TestComponentBuilder], (tcb) => {
- builder = tcb;
- }));
-
- describe('md-backdrop', () => {
-
- describe('transitionClass', () => {
- it('should be added to classList when shown', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- return promiseWait().then(() => {
- api.fixture.detectChanges();
- let el = api.debug.nativeElement;
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
- });
- });
- }));
-
- it('should be removed from classList when hidden', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- return promiseWait().then(() => {
- let el = api.debug.nativeElement;
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
- return api.backdrop
- .hide()
- .then(() => promiseWait())
- .then(() => {
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
- });
- });
- });
- }));
- });
+ describe('md-backdrop', () => {
- describe('transitionAddClass=false', () => {
- it('should remove transitionClass when shown', async(() => {
- return setup(false, false).then((api: IBackdropFixture) => {
+ describe('transitionClass', () => {
+ it('should be added to classList when shown', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ promiseWait().then(() => {
+ api.fixture.detectChanges();
let el = api.debug.nativeElement;
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
- el.classList.contains(api.backdrop.transitionClass);
- return api.backdrop.show().then(() => {
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
- });
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
});
- }));
+ });
+ }));
- it('should add transitionClass when hidden', async(() => {
- return setup(true, false).then((api: IBackdropFixture) => {
+ it('should be removed from classList when hidden', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ return promiseWait().then(() => {
let el = api.debug.nativeElement;
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
- return api.backdrop.hide().then(() => {
- expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
- });
- });
- }));
- });
-
- describe('clickClose', () => {
- it('should be hidden by a click when true', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- let triggered = false;
- api.backdrop.clickClose = true;
- api.backdrop.hide = () => {
- triggered = true;
- return Promise.resolve();
- };
- api.debug.nativeElement.click();
- expect(triggered).toBe(true);
- })
- .catch(error => console.error.bind(console));
- }));
-
- it('should not be hidden when clickClose is false', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- let triggered = false;
- api.backdrop.clickClose = false;
- api.backdrop.hide = () => {
- triggered = true;
- return Promise.resolve();
- };
- api.debug.nativeElement.click();
- expect(triggered).toBe(false);
- })
- .catch(error => console.error.bind(console));
- }));
-
- it('should not be clickable during transition animation', async(() => {
- return setup().then((api: IBackdropFixture) => {
- let triggered = false;
- api.backdrop.clickClose = true;
- api.backdrop.hide = () => {
- triggered = true;
- return Promise.resolve();
- };
- let promise = api.backdrop.show();
- api.debug.nativeElement.click();
- expect(triggered).toBe(false);
- return promise.then(() => {
- expect(triggered).toBe(false);
- api.debug.nativeElement.click();
- expect(triggered).toBe(true);
- });
- })
- .catch(error => console.error.bind(console));
- }));
- });
-
- describe('show', () => {
- it('emit events before and after being shown', () => {
- return setup().then((api: IBackdropFixture) => {
- let changes: string[] = [];
- expect(api.backdrop.visible).toBe(false);
- api.backdrop.onShowing.subscribe(() => changes.push('showing'));
- api.backdrop.onShown.subscribe(() => changes.push('shown'));
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
return api.backdrop
- .show()
+ .hide()
.then(() => promiseWait())
.then(() => {
- expect(changes.length).toBe(2);
- expect(changes[0]).toBe('showing');
- expect(changes[1]).toBe('shown');
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
});
});
});
+ }));
+ });
- it('does not emit events events if already shown', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- let changes: number = 0;
- api.backdrop.onShowing.subscribe(() => changes++);
- api.backdrop.onShown.subscribe(() => changes++);
- return api.backdrop
- .show()
- .then(() => promiseWait())
- .then(() => {
- expect(changes).toBe(0);
- });
- })
- .catch(error => console.error.bind(console));
- }));
- });
+ describe('transitionAddClass=false', () => {
+ it('should remove transitionClass when shown', async(() => {
+ return setup(false, false).then((api: IBackdropFixture) => {
+ let el = api.debug.nativeElement;
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
+ el.classList.contains(api.backdrop.transitionClass);
+ return api.backdrop.show().then(() => {
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
+ });
+ });
+ }));
+
+ it('should add transitionClass when hidden', async(() => {
+ return setup(true, false).then((api: IBackdropFixture) => {
+ let el = api.debug.nativeElement;
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(false);
+ return api.backdrop.hide().then(() => {
+ expect(el.classList.contains(api.backdrop.transitionClass)).toBe(true);
+ });
+ });
+ }));
+ });
- describe('hide', () => {
- it('hide emits events before and after being hidden', async(() => {
- return setup(true).then((api: IBackdropFixture) => {
- let changes: string[] = [];
- api.backdrop.onHiding.subscribe(() => changes.push('hiding'));
- api.backdrop.onHidden.subscribe(() => changes.push('hidden'));
- return api.backdrop
- .hide()
- .then(() => promiseWait())
- .then(() => {
- expect(changes.length).toBe(2);
- expect(changes[0]).toBe('hiding');
- expect(changes[1]).toBe('hidden');
- });
- })
- .catch(error => console.error.bind(console));
- }));
-
- it('does not emit events events if already hidden', async(() => {
- return setup().then((api: IBackdropFixture) => {
- let changes: number = 0;
- expect(api.backdrop.visible).toBe(false);
- api.backdrop.onHiding.subscribe(() => changes++);
- api.backdrop.onHidden.subscribe(() => changes++);
- return api.backdrop
- .hide()
- .then(() => promiseWait())
- .then(() => {
- expect(changes).toBe(0);
- });
- })
- .catch(error => console.error.bind(console));
- }));
+ describe('clickClose', () => {
+ it('should be hidden by a click when true', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ let triggered = false;
+ api.backdrop.clickClose = true;
+ api.backdrop.hide = () => {
+ triggered = true;
+ return Promise.resolve();
+ };
+ api.debug.nativeElement.click();
+ expect(triggered).toBe(true);
+ })
+ .catch(error => console.error.bind(console));
+ }));
+
+ it('should not be hidden when clickClose is false', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ let triggered = false;
+ api.backdrop.clickClose = false;
+ api.backdrop.hide = () => {
+ triggered = true;
+ return Promise.resolve();
+ };
+ api.debug.nativeElement.click();
+ expect(triggered).toBe(false);
+ })
+ .catch(error => console.error.bind(console));
+ }));
+
+ it('should not be clickable during transition animation', async(() => {
+ return setup().then((api: IBackdropFixture) => {
+ let triggered = false;
+ api.backdrop.clickClose = true;
+ api.backdrop.hide = () => {
+ triggered = true;
+ return Promise.resolve();
+ };
+ let promise = api.backdrop.show();
+ api.debug.nativeElement.click();
+ expect(triggered).toBe(false);
+ return promise.then(() => {
+ expect(triggered).toBe(false);
+ api.debug.nativeElement.click();
+ expect(triggered).toBe(true);
+ });
+ })
+ .catch(error => console.error.bind(console));
+ }));
+ });
+
+ describe('show', () => {
+ it('emit events before and after being shown', () => {
+ return setup().then((api: IBackdropFixture) => {
+ let changes: string[] = [];
+ expect(api.backdrop.visible).toBe(false);
+ api.backdrop.onShowing.subscribe(() => changes.push('showing'));
+ api.backdrop.onShown.subscribe(() => changes.push('shown'));
+ return api.backdrop
+ .show()
+ .then(() => promiseWait())
+ .then(() => {
+ expect(changes.length).toBe(2);
+ expect(changes[0]).toBe('showing');
+ expect(changes[1]).toBe('shown');
+ });
+ });
});
+
+ it('does not emit events events if already shown', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ let changes: number = 0;
+ api.backdrop.onShowing.subscribe(() => changes++);
+ api.backdrop.onShown.subscribe(() => changes++);
+ return api.backdrop
+ .show()
+ .then(() => promiseWait())
+ .then(() => {
+ expect(changes).toBe(0);
+ });
+ })
+ .catch(error => console.error.bind(console));
+ }));
});
+ describe('hide', () => {
+ it('hide emits events before and after being hidden', async(() => {
+ return setup(true).then((api: IBackdropFixture) => {
+ let changes: string[] = [];
+ api.backdrop.onHiding.subscribe(() => changes.push('hiding'));
+ api.backdrop.onHidden.subscribe(() => changes.push('hidden'));
+ return api.backdrop
+ .hide()
+ .then(() => promiseWait())
+ .then(() => {
+ expect(changes.length).toBe(2);
+ expect(changes[0]).toBe('hiding');
+ expect(changes[1]).toBe('hidden');
+ });
+ })
+ .catch(error => console.error.bind(console));
+ }));
+
+ it('does not emit events events if already hidden', async(() => {
+ return setup().then((api: IBackdropFixture) => {
+ let changes: number = 0;
+ expect(api.backdrop.visible).toBe(false);
+ api.backdrop.onHiding.subscribe(() => changes++);
+ api.backdrop.onHidden.subscribe(() => changes++);
+ return api.backdrop
+ .hide()
+ .then(() => promiseWait())
+ .then(() => {
+ expect(changes).toBe(0);
+ });
+ })
+ .catch(error => console.error.bind(console));
+ }));
+ });
});
-
-}
+});
diff --git a/src/components/button/button.scss b/src/components/button/button.scss
deleted file mode 100644
index ae98edd3..00000000
--- a/src/components/button/button.scss
+++ /dev/null
@@ -1,283 +0,0 @@
-@import "../../core/style/variables";
-@import "../../core/style/shadows";
-// TODO(jelbourn): This goes away.
-@import "../../core/style/default-theme";
-
-// TODO(jelbourn): Move variables and mixins into a partial file.
-// TODO(jelbourn): Measure perf benefits for translate3d and will-change.
-// TODO(jelbourn): Figure out if anchor hover underline actually happens in any browser.
-
-// Standard button sizing.
-$md-button-padding: 0 rem(0.600) !default;
-$md-button-min-width: rem(8.800) !default;
-$md-button-margin: rem(0.600) rem(0.800) !default;
-$md-button-line-height: rem(3.60) !default;
-$md-button-border-radius: 3px !default;
-
-// FAB sizing.
-$md-fab-border-radius: 50%;
-$md-fab-size: rem(5.600) !default;
-$md-fab-line-height: rem(5.600) !default;
-$md-fab-padding: rem(1.60) !default;
-$md-fab-mini-size: rem(4.00) !default;
-$md-fab-mini-line-height: rem(4.00) !default;
-
-// Icon button sizing.
-$md-icon-button-height: rem(4.000) !default;
-$md-icon-button-width: rem(4.000) !default;
-$md-icon-button-margin: rem(0.600) !default;
-$md-icon-border-radius: $md-fab-border-radius;
-
-/** Mixin to create distinct classes for fab positions, e.g. ".md-fab-position-bottom-right". */
-@mixin md-fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) {
- .md-fab-position-#{$spot} {
- top: $top;
- right: $right;
- bottom: $bottom;
- left: $left;
- position: absolute;
- }
-}
-
-@mixin md-ripple-base() {
- background-clip: padding-box;
- overflow: hidden;
- // The following hack causes Safari/Chrome to respect overflow hidden for ripples
- -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC');
-}
-
-/** Mixin to set button size to fit an icon */
-@mixin md-button-icon {
- margin: 0 $md-icon-button-margin;
- height: $md-icon-button-height;
- min-width: 0;
- line-height: $icon-size;
- padding: $baseline-grid;
- width: $md-icon-button-width;
- border-radius: $md-icon-border-radius;
- .md-ripple-container {
- border-radius: $md-icon-border-radius;
- @include md-ripple-base();
- }
-}
-
-/** Styles for all disabled buttons. */
-@mixin md-button-disabled() {
- color: md-color($md-foreground, disabled);
- background-color: md-color($md-background, 300);
- cursor: default;
-}
-
-/** Base styles for all buttons. */
-@mixin md-button-base() {
- box-sizing: border-box;
- position: relative;
-
- // Reset browser