├── cli-schematics ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── material │ │ │ └── material.module.ts │ ├── assets │ │ └── .gitkeep │ ├── browserslist │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.json └── tslint.json └── material-demo ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── autocomplete │ │ ├── autocomplete.component.css │ │ ├── autocomplete.component.html │ │ └── autocomplete.component.ts │ ├── badge │ │ ├── badge.component.css │ │ ├── badge.component.html │ │ └── badge.component.ts │ ├── button-toggle │ │ ├── button-toggle.component.css │ │ ├── button-toggle.component.html │ │ └── button-toggle.component.ts │ ├── button │ │ ├── button.component.css │ │ ├── button.component.html │ │ └── button.component.ts │ ├── cards │ │ ├── cards.component.css │ │ ├── cards.component.html │ │ └── cards.component.ts │ ├── checkbox │ │ ├── checkbox.component.css │ │ ├── checkbox.component.html │ │ └── checkbox.component.ts │ ├── datatable │ │ ├── datatable.component.css │ │ ├── datatable.component.html │ │ └── datatable.component.ts │ ├── datepicker │ │ ├── datepicker.component.css │ │ ├── datepicker.component.html │ │ └── datepicker.component.ts │ ├── dialog-example │ │ ├── dialog-example.component.css │ │ ├── dialog-example.component.html │ │ └── dialog-example.component.ts │ ├── dialog │ │ ├── dialog.component.css │ │ ├── dialog.component.html │ │ └── dialog.component.ts │ ├── expansion-panel │ │ ├── expansion-panel.component.css │ │ ├── expansion-panel.component.html │ │ └── expansion-panel.component.ts │ ├── grid-list │ │ ├── grid-list.component.css │ │ ├── grid-list.component.html │ │ └── grid-list.component.ts │ ├── icons │ │ ├── icons.component.css │ │ ├── icons.component.html │ │ └── icons.component.ts │ ├── input │ │ ├── input.component.css │ │ ├── input.component.html │ │ └── input.component.ts │ ├── list │ │ ├── list.component.css │ │ ├── list.component.html │ │ └── list.component.ts │ ├── material │ │ └── material.module.ts │ ├── menu │ │ ├── menu.component.css │ │ ├── menu.component.html │ │ └── menu.component.ts │ ├── progress-spinner │ │ ├── progress-spinner.component.css │ │ ├── progress-spinner.component.html │ │ └── progress-spinner.component.ts │ ├── radiobutton │ │ ├── radiobutton.component.css │ │ ├── radiobutton.component.html │ │ └── radiobutton.component.ts │ ├── select │ │ ├── select.component.css │ │ ├── select.component.html │ │ └── select.component.ts │ ├── sidenav │ │ ├── sidenav.component.css │ │ ├── sidenav.component.html │ │ └── sidenav.component.ts │ ├── snackbar │ │ ├── snackbar.component.css │ │ ├── snackbar.component.html │ │ └── snackbar.component.ts │ ├── stepper │ │ ├── stepper.component.css │ │ ├── stepper.component.html │ │ └── stepper.component.ts │ ├── tabs │ │ ├── tabs.component.css │ │ ├── tabs.component.html │ │ └── tabs.component.ts │ ├── toolbar │ │ ├── toolbar.component.css │ │ ├── toolbar.component.html │ │ └── toolbar.component.ts │ ├── tooltip │ │ ├── tooltip.component.css │ │ ├── tooltip.component.html │ │ └── tooltip.component.ts │ ├── typography │ │ ├── typography.component.css │ │ ├── typography.component.html │ │ └── typography.component.ts │ └── virtual-scrolling │ │ ├── virtual-scrolling.component.css │ │ ├── virtual-scrolling.component.html │ │ └── virtual-scrolling.component.ts ├── assets │ └── .gitkeep ├── browserslist ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json └── tslint.json /cli-schematics/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /cli-schematics/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /cli-schematics/README.md: -------------------------------------------------------------------------------- 1 | # CliSchematics 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /cli-schematics/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "cli-schematics": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/cli-schematics", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | { 27 | "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" 28 | }, 29 | "src/styles.css" 30 | ], 31 | "scripts": [] 32 | }, 33 | "configurations": { 34 | "production": { 35 | "fileReplacements": [ 36 | { 37 | "replace": "src/environments/environment.ts", 38 | "with": "src/environments/environment.prod.ts" 39 | } 40 | ], 41 | "optimization": true, 42 | "outputHashing": "all", 43 | "sourceMap": false, 44 | "extractCss": true, 45 | "namedChunks": false, 46 | "aot": true, 47 | "extractLicenses": true, 48 | "vendorChunk": false, 49 | "buildOptimizer": true 50 | } 51 | } 52 | }, 53 | "serve": { 54 | "builder": "@angular-devkit/build-angular:dev-server", 55 | "options": { 56 | "browserTarget": "cli-schematics:build" 57 | }, 58 | "configurations": { 59 | "production": { 60 | "browserTarget": "cli-schematics:build:production" 61 | } 62 | } 63 | }, 64 | "extract-i18n": { 65 | "builder": "@angular-devkit/build-angular:extract-i18n", 66 | "options": { 67 | "browserTarget": "cli-schematics:build" 68 | } 69 | }, 70 | "test": { 71 | "builder": "@angular-devkit/build-angular:karma", 72 | "options": { 73 | "main": "src/test.ts", 74 | "polyfills": "src/polyfills.ts", 75 | "tsConfig": "src/tsconfig.spec.json", 76 | "karmaConfig": "src/karma.conf.js", 77 | "styles": [ 78 | { 79 | "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" 80 | }, 81 | "src/styles.css" 82 | ], 83 | "scripts": [], 84 | "assets": [ 85 | "src/favicon.ico", 86 | "src/assets" 87 | ] 88 | } 89 | }, 90 | "lint": { 91 | "builder": "@angular-devkit/build-angular:tslint", 92 | "options": { 93 | "tsConfig": [ 94 | "src/tsconfig.app.json", 95 | "src/tsconfig.spec.json" 96 | ], 97 | "exclude": [ 98 | "**/node_modules/**" 99 | ] 100 | } 101 | } 102 | } 103 | }, 104 | "cli-schematics-e2e": { 105 | "root": "e2e/", 106 | "projectType": "application", 107 | "architect": { 108 | "e2e": { 109 | "builder": "@angular-devkit/build-angular:protractor", 110 | "options": { 111 | "protractorConfig": "e2e/protractor.conf.js", 112 | "devServerTarget": "cli-schematics:serve" 113 | }, 114 | "configurations": { 115 | "production": { 116 | "devServerTarget": "cli-schematics:serve:production" 117 | } 118 | } 119 | }, 120 | "lint": { 121 | "builder": "@angular-devkit/build-angular:tslint", 122 | "options": { 123 | "tsConfig": "e2e/tsconfig.e2e.json", 124 | "exclude": [ 125 | "**/node_modules/**" 126 | ] 127 | } 128 | } 129 | } 130 | } 131 | }, 132 | "defaultProject": "cli-schematics" 133 | } -------------------------------------------------------------------------------- /cli-schematics/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /cli-schematics/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to cli-schematics!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /cli-schematics/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /cli-schematics/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /cli-schematics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cli-schematics", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^6.1.0", 15 | "@angular/common": "^6.1.0", 16 | "@angular/compiler": "^6.1.0", 17 | "@angular/core": "^6.1.0", 18 | "@angular/forms": "^6.1.0", 19 | "@angular/http": "^6.1.0", 20 | "@angular/material": "^6.4.6", 21 | "@angular/platform-browser": "^6.1.0", 22 | "@angular/platform-browser-dynamic": "^6.1.0", 23 | "@angular/router": "^6.1.0", 24 | "core-js": "^2.5.4", 25 | "rxjs": "^6.0.0", 26 | "zone.js": "~0.8.26", 27 | "@angular/cdk": "^6.2.0" 28 | }, 29 | "devDependencies": { 30 | "@angular-devkit/build-angular": "~0.7.0", 31 | "@angular/cli": "~6.1.3", 32 | "@angular/compiler-cli": "^6.1.0", 33 | "@angular/language-service": "^6.1.0", 34 | "@types/jasmine": "~2.8.6", 35 | "@types/jasminewd2": "~2.0.3", 36 | "@types/node": "~8.9.4", 37 | "codelyzer": "~4.2.1", 38 | "jasmine-core": "~2.99.1", 39 | "jasmine-spec-reporter": "~4.2.1", 40 | "karma": "~1.7.1", 41 | "karma-chrome-launcher": "~2.2.0", 42 | "karma-coverage-istanbul-reporter": "~2.0.0", 43 | "karma-jasmine": "~1.1.1", 44 | "karma-jasmine-html-reporter": "^0.2.2", 45 | "protractor": "~5.3.0", 46 | "ts-node": "~5.0.1", 47 | "tslint": "~5.9.1", 48 | "typescript": "~2.7.2" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /cli-schematics/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/cli-schematics/src/app/app.component.css -------------------------------------------------------------------------------- /cli-schematics/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli-schematics/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'cli-schematics'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('cli-schematics'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to cli-schematics!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /cli-schematics/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'cli-schematics'; 10 | } 11 | -------------------------------------------------------------------------------- /cli-schematics/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { AppComponent } from './app.component'; 4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 5 | import { MaterialModule } from './material/material.module'; 6 | 7 | @NgModule({ 8 | declarations: [AppComponent], 9 | imports: [BrowserModule, BrowserAnimationsModule, MaterialModule], 10 | providers: [], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule {} 14 | -------------------------------------------------------------------------------- /cli-schematics/src/app/material/material.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MatButtonModule } from '@angular/material'; 3 | 4 | const MaterialComponents = [MatButtonModule]; 5 | 6 | @NgModule({ 7 | imports: [MaterialComponents], 8 | exports: [MaterialComponents] 9 | }) 10 | export class MaterialModule {} 11 | -------------------------------------------------------------------------------- /cli-schematics/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/cli-schematics/src/assets/.gitkeep -------------------------------------------------------------------------------- /cli-schematics/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /cli-schematics/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /cli-schematics/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, for easier debugging, you can ignore zone related error 11 | * stack frames such as `zone.run`/`zoneDelegate.invokeTask` by importing the 12 | * below file. Don't forget to comment it out in production mode 13 | * because it will have a performance impact when errors are thrown 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /cli-schematics/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/cli-schematics/src/favicon.ico -------------------------------------------------------------------------------- /cli-schematics/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CliSchematics 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /cli-schematics/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /cli-schematics/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /cli-schematics/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /cli-schematics/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 0; font-family: 'Roboto', sans-serif; } 5 | -------------------------------------------------------------------------------- /cli-schematics/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /cli-schematics/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "src/test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /cli-schematics/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /cli-schematics/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cli-schematics/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cli-schematics/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /material-demo/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /material-demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /material-demo/README.md: -------------------------------------------------------------------------------- 1 | # MaterialDemo 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /material-demo/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "material-demo": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/material-demo", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | { 27 | "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" 28 | }, 29 | "src/styles.css" 30 | ], 31 | "scripts": [] 32 | }, 33 | "configurations": { 34 | "production": { 35 | "fileReplacements": [ 36 | { 37 | "replace": "src/environments/environment.ts", 38 | "with": "src/environments/environment.prod.ts" 39 | } 40 | ], 41 | "optimization": true, 42 | "outputHashing": "all", 43 | "sourceMap": false, 44 | "extractCss": true, 45 | "namedChunks": false, 46 | "aot": true, 47 | "extractLicenses": true, 48 | "vendorChunk": false, 49 | "buildOptimizer": true 50 | } 51 | } 52 | }, 53 | "serve": { 54 | "builder": "@angular-devkit/build-angular:dev-server", 55 | "options": { 56 | "browserTarget": "material-demo:build" 57 | }, 58 | "configurations": { 59 | "production": { 60 | "browserTarget": "material-demo:build:production" 61 | } 62 | } 63 | }, 64 | "extract-i18n": { 65 | "builder": "@angular-devkit/build-angular:extract-i18n", 66 | "options": { 67 | "browserTarget": "material-demo:build" 68 | } 69 | }, 70 | "test": { 71 | "builder": "@angular-devkit/build-angular:karma", 72 | "options": { 73 | "main": "src/test.ts", 74 | "polyfills": "src/polyfills.ts", 75 | "tsConfig": "src/tsconfig.spec.json", 76 | "karmaConfig": "src/karma.conf.js", 77 | "styles": [ 78 | { 79 | "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" 80 | }, 81 | "src/styles.css" 82 | ], 83 | "scripts": [], 84 | "assets": [ 85 | "src/favicon.ico", 86 | "src/assets" 87 | ] 88 | } 89 | }, 90 | "lint": { 91 | "builder": "@angular-devkit/build-angular:tslint", 92 | "options": { 93 | "tsConfig": [ 94 | "src/tsconfig.app.json", 95 | "src/tsconfig.spec.json" 96 | ], 97 | "exclude": [ 98 | "**/node_modules/**" 99 | ] 100 | } 101 | } 102 | } 103 | }, 104 | "material-demo-e2e": { 105 | "root": "e2e/", 106 | "projectType": "application", 107 | "architect": { 108 | "e2e": { 109 | "builder": "@angular-devkit/build-angular:protractor", 110 | "options": { 111 | "protractorConfig": "e2e/protractor.conf.js", 112 | "devServerTarget": "material-demo:serve" 113 | }, 114 | "configurations": { 115 | "production": { 116 | "devServerTarget": "material-demo:serve:production" 117 | } 118 | } 119 | }, 120 | "lint": { 121 | "builder": "@angular-devkit/build-angular:tslint", 122 | "options": { 123 | "tsConfig": "e2e/tsconfig.e2e.json", 124 | "exclude": [ 125 | "**/node_modules/**" 126 | ] 127 | } 128 | } 129 | } 130 | } 131 | }, 132 | "defaultProject": "material-demo" 133 | } -------------------------------------------------------------------------------- /material-demo/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /material-demo/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to material-demo!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /material-demo/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /material-demo/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /material-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "material-demo", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^7.2.2", 15 | "@angular/common": "^7.2.2", 16 | "@angular/compiler": "^7.2.2", 17 | "@angular/core": "^7.2.2", 18 | "@angular/forms": "^7.2.2", 19 | "@angular/http": "^7.2.2", 20 | "@angular/material": "^7.2.2", 21 | "@angular/platform-browser": "^7.2.2", 22 | "@angular/platform-browser-dynamic": "^7.2.2", 23 | "@angular/router": "^7.2.2", 24 | "core-js": "^2.5.4", 25 | "rxjs": "^6.3.3", 26 | "tslib": "^1.9.0", 27 | "zone.js": "~0.8.29", 28 | "@angular/cdk": "^7.2.2" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.12.0", 32 | "@angular/cli": "~7.2.3", 33 | "@angular/compiler-cli": "^7.2.2", 34 | "@angular/language-service": "^7.2.2", 35 | "@types/jasmine": "~2.8.6", 36 | "@types/jasminewd2": "~2.0.3", 37 | "@types/node": "~8.9.4", 38 | "codelyzer": "~4.2.1", 39 | "jasmine-core": "~2.99.1", 40 | "jasmine-spec-reporter": "~4.2.1", 41 | "karma": "~1.7.1", 42 | "karma-chrome-launcher": "~2.2.0", 43 | "karma-coverage-istanbul-reporter": "~2.0.0", 44 | "karma-jasmine": "~1.1.1", 45 | "karma-jasmine-html-reporter": "^0.2.2", 46 | "protractor": "~5.3.0", 47 | "ts-node": "~5.0.1", 48 | "tslint": "~5.9.1", 49 | "typescript": "~3.2.4" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /material-demo/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/app.component.css -------------------------------------------------------------------------------- /material-demo/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /material-demo/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'material-demo'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('material-demo'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to material-demo!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /material-demo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'material-demo'; 10 | } 11 | -------------------------------------------------------------------------------- /material-demo/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import {FormsModule, ReactiveFormsModule} from '@angular/forms'; 4 | import { AppComponent } from './app.component'; 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 6 | import { TypographyComponent } from './typography/typography.component'; 7 | import { ButtonComponent } from './button/button.component'; 8 | import { MaterialModule } from './material/material.module'; 9 | import { BadgeComponent } from './badge/badge.component'; 10 | import { IconsComponent } from './icons/icons.component'; 11 | import { ProgressSpinnerComponent } from './progress-spinner/progress-spinner.component'; 12 | import { ToolbarComponent } from './toolbar/toolbar.component'; 13 | import { MenuComponent } from './menu/menu.component'; 14 | import { TooltipComponent } from './tooltip/tooltip.component'; 15 | import { ListComponent } from './list/list.component'; 16 | import { GridListComponent } from './grid-list/grid-list.component'; 17 | import { TabsComponent } from './tabs/tabs.component'; 18 | import { CardsComponent } from './cards/cards.component'; 19 | import { InputComponent } from './input/input.component'; 20 | import { SelectComponent } from './select/select.component'; 21 | import { CheckboxComponent } from './checkbox/checkbox.component'; 22 | import { RadiobuttonComponent } from './radiobutton/radiobutton.component'; 23 | import { DatatableComponent } from './datatable/datatable.component'; 24 | import { ButtonToggleComponent } from './button-toggle/button-toggle.component'; 25 | import { SidenavComponent } from './sidenav/sidenav.component'; 26 | import { ExpansionPanelComponent } from './expansion-panel/expansion-panel.component'; 27 | import { StepperComponent } from './stepper/stepper.component'; 28 | import { AutocompleteComponent } from './autocomplete/autocomplete.component'; 29 | import { DatepickerComponent } from './datepicker/datepicker.component'; 30 | import { SnackbarComponent, CustomSnackBarComponent } from './snackbar/snackbar.component'; 31 | import { DialogComponent } from './dialog/dialog.component'; 32 | import { DialogExampleComponent } from './dialog-example/dialog-example.component'; 33 | import { VirtualScrollingComponent } from './virtual-scrolling/virtual-scrolling.component'; 34 | import {ScrollingModule} from '@angular/cdk/scrolling'; 35 | @NgModule({ 36 | declarations: [ 37 | AppComponent, 38 | TypographyComponent, 39 | ButtonComponent, 40 | BadgeComponent, 41 | IconsComponent, 42 | ProgressSpinnerComponent, 43 | ToolbarComponent, 44 | MenuComponent, 45 | TooltipComponent, 46 | ListComponent, 47 | GridListComponent, 48 | TabsComponent, 49 | CardsComponent, 50 | InputComponent, 51 | SelectComponent, 52 | CheckboxComponent, 53 | RadiobuttonComponent, 54 | DatatableComponent, 55 | ButtonToggleComponent, 56 | SidenavComponent, 57 | ExpansionPanelComponent, 58 | StepperComponent, 59 | AutocompleteComponent, 60 | DatepickerComponent, 61 | SnackbarComponent, 62 | CustomSnackBarComponent, 63 | DialogComponent, 64 | DialogExampleComponent, 65 | VirtualScrollingComponent 66 | ], 67 | entryComponents: [CustomSnackBarComponent, DialogExampleComponent], 68 | imports: [ 69 | BrowserModule, 70 | BrowserAnimationsModule, 71 | FormsModule, 72 | ReactiveFormsModule, 73 | MaterialModule, 74 | ScrollingModule 75 | ], 76 | providers: [], 77 | bootstrap: [AppComponent] 78 | }) 79 | export class AppModule { } 80 | -------------------------------------------------------------------------------- /material-demo/src/app/autocomplete/autocomplete.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/autocomplete/autocomplete.component.css -------------------------------------------------------------------------------- /material-demo/src/app/autocomplete/autocomplete.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | {{option}} 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /material-demo/src/app/autocomplete/autocomplete.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core' 2 | import { FormControl } from '@angular/forms' 3 | import { Observable } from 'rxjs' 4 | import { map, startWith } from 'rxjs/operators' 5 | 6 | @Component({ 7 | selector: 'app-autocomplete', 8 | templateUrl: './autocomplete.component.html', 9 | styleUrls: ['./autocomplete.component.css'] 10 | }) 11 | export class AutocompleteComponent implements OnInit { 12 | constructor() {} 13 | 14 | ngOnInit() { 15 | this.filteredOptions = this.myControl.valueChanges.pipe( 16 | startWith(''), 17 | map(value => this._filter(value)) 18 | ) 19 | } 20 | 21 | myControl = new FormControl() 22 | options: string[] = ['Angular', 'React', 'Vue'] 23 | objectOptions = [ 24 | { name: 'Angular' }, 25 | { name: 'Angular Material' }, 26 | { name: 'React' }, 27 | { name: 'Vue' } 28 | ] 29 | filteredOptions: Observable 30 | 31 | displayFn(subject) { 32 | console.log(subject) 33 | return subject ? subject.name : undefined 34 | } 35 | 36 | private _filter(value: string): string[] { 37 | const filterValue = value.toLowerCase() 38 | return this.options.filter(option => 39 | option.toLowerCase().includes(filterValue) 40 | ) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /material-demo/src/app/badge/badge.component.css: -------------------------------------------------------------------------------- 1 | div { 2 | margin: 3rem; 3 | } 4 | -------------------------------------------------------------------------------- /material-demo/src/app/badge/badge.component.html: -------------------------------------------------------------------------------- 1 |
2 | Notifications 3 |
4 |
5 | Notifications 6 |
7 |
8 | Notifications 9 |
10 |
11 | Notifications 12 |
13 |
14 | Notifications 15 |
16 |
17 | Notifications 18 |
19 |
20 | Notifications 21 |
22 |
23 | Notifications 24 |
25 |
26 | Notifications 27 |
28 |
29 | Notifications 30 |
31 | -------------------------------------------------------------------------------- /material-demo/src/app/badge/badge.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-badge', 5 | templateUrl: './badge.component.html', 6 | styleUrls: ['./badge.component.css'] 7 | }) 8 | export class BadgeComponent implements OnInit { 9 | 10 | notifications = 0; 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /material-demo/src/app/button-toggle/button-toggle.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/button-toggle/button-toggle.component.css -------------------------------------------------------------------------------- /material-demo/src/app/button-toggle/button-toggle.component.html: -------------------------------------------------------------------------------- 1 |
2 | Toggle 3 | {{ toggleBtn.checked }} 4 |
5 |
6 | 7 | Angular 8 | React 9 | Vue 10 | 11 | {{toggleGroup.value}} 12 |
13 | -------------------------------------------------------------------------------- /material-demo/src/app/button-toggle/button-toggle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-button-toggle', 5 | templateUrl: './button-toggle.component.html', 6 | styleUrls: ['./button-toggle.component.css'] 7 | }) 8 | export class ButtonToggleComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/button/button.component.css: -------------------------------------------------------------------------------- 1 | button { 2 | margin-right: 3rem; 3 | } 4 | -------------------------------------------------------------------------------- /material-demo/src/app/button/button.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /material-demo/src/app/button/button.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-button', 5 | templateUrl: './button.component.html', 6 | styleUrls: ['./button.component.css'] 7 | }) 8 | export class ButtonComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/cards/cards.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/cards/cards.component.css -------------------------------------------------------------------------------- /material-demo/src/app/cards/cards.component.html: -------------------------------------------------------------------------------- 1 | Basic card 2 |
3 | 4 | 5 | Card Title 6 | 7 | 8 | This is the card content 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /material-demo/src/app/cards/cards.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-cards', 5 | templateUrl: './cards.component.html', 6 | styleUrls: ['./cards.component.css'] 7 | }) 8 | export class CardsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/checkbox/checkbox.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/checkbox/checkbox.component.css -------------------------------------------------------------------------------- /material-demo/src/app/checkbox/checkbox.component.html: -------------------------------------------------------------------------------- 1 | Subscribe 2 |
3 | Subscribe 4 |
5 | Subscribe 6 |
7 | Subscribe 8 | -------------------------------------------------------------------------------- /material-demo/src/app/checkbox/checkbox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-checkbox', 5 | templateUrl: './checkbox.component.html', 6 | styleUrls: ['./checkbox.component.css'] 7 | }) 8 | export class CheckboxComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/datatable/datatable.component.css: -------------------------------------------------------------------------------- 1 | table { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /material-demo/src/app/datatable/datatable.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | No. 10 | {{element.position}} 11 | 12 | 13 | 14 | 15 | Name 16 | {{element.name}} 17 | 18 | 19 | 20 | 21 | Weight 22 | {{element.weight}} 23 | 24 | 25 | 26 | 27 | Symbol 28 | {{element.symbol}} 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /material-demo/src/app/datatable/datatable.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild } from '@angular/core'; 2 | import { MatTableDataSource, MatSort, MatPaginator } from '@angular/material'; 3 | 4 | export interface PeriodicElement { 5 | name: string; 6 | position: number; 7 | weight: number; 8 | symbol: string; 9 | } 10 | 11 | const ELEMENT_DATA: PeriodicElement[] = [ 12 | {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'}, 13 | {position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'}, 14 | {position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'}, 15 | {position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'}, 16 | {position: 5, name: 'Boron', weight: 10.811, symbol: 'B'}, 17 | {position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'}, 18 | {position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'}, 19 | {position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'}, 20 | {position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'}, 21 | {position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'}, 22 | ]; 23 | 24 | @Component({ 25 | selector: 'app-datatable', 26 | templateUrl: './datatable.component.html', 27 | styleUrls: ['./datatable.component.css'] 28 | }) 29 | export class DatatableComponent implements OnInit { 30 | 31 | displayedColumns: string[] = ['name', 'position', 'weight', 'symbol']; 32 | displayedColumnsData: string[] = ['name', 'position', 'weight']; 33 | dataSource = new MatTableDataSource(ELEMENT_DATA); 34 | @ViewChild(MatSort) sort: MatSort; 35 | @ViewChild(MatPaginator) paginator: MatPaginator; 36 | 37 | constructor() { } 38 | 39 | 40 | ngOnInit() { 41 | this.dataSource.sort = this.sort; 42 | this.dataSource.paginator = this.paginator; 43 | } 44 | 45 | logData(row) { 46 | console.log(row); 47 | } 48 | 49 | applyFilter(filterValue: string) { 50 | this.dataSource.filter = filterValue.trim().toLowerCase(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /material-demo/src/app/datepicker/datepicker.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/datepicker/datepicker.component.css -------------------------------------------------------------------------------- /material-demo/src/app/datepicker/datepicker.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /material-demo/src/app/datepicker/datepicker.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-datepicker', 5 | templateUrl: './datepicker.component.html', 6 | styleUrls: ['./datepicker.component.css'] 7 | }) 8 | export class DatepickerComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | minDate = new Date() 16 | maxDate = new Date(2019, 1, 25) 17 | 18 | dateFilter = (date) => { 19 | const day = date.getDay(); 20 | // Prevent Saturday and Sunday from being selected. 21 | return day !== 0 && day !== 6; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /material-demo/src/app/dialog-example/dialog-example.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/dialog-example/dialog-example.component.css -------------------------------------------------------------------------------- /material-demo/src/app/dialog-example/dialog-example.component.html: -------------------------------------------------------------------------------- 1 |

Session Timeout

2 | Hi {{data.name}}, You will be logged out due to inactivity 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /material-demo/src/app/dialog-example/dialog-example.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Inject } from '@angular/core'; 2 | import {MAT_DIALOG_DATA} from '@angular/material'; 3 | 4 | @Component({ 5 | selector: 'app-dialog-example', 6 | templateUrl: './dialog-example.component.html', 7 | styleUrls: ['./dialog-example.component.css'] 8 | }) 9 | export class DialogExampleComponent implements OnInit { 10 | 11 | constructor(@Inject(MAT_DIALOG_DATA) public data: any) { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /material-demo/src/app/dialog/dialog.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/dialog/dialog.component.css -------------------------------------------------------------------------------- /material-demo/src/app/dialog/dialog.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /material-demo/src/app/dialog/dialog.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MatDialog } from '@angular/material'; 3 | import { DialogExampleComponent } from '../dialog-example/dialog-example.component'; 4 | 5 | @Component({ 6 | selector: 'app-dialog', 7 | templateUrl: './dialog.component.html', 8 | styleUrls: ['./dialog.component.css'] 9 | }) 10 | export class DialogComponent implements OnInit { 11 | 12 | constructor(public dialog: MatDialog) {} 13 | 14 | ngOnInit() { 15 | } 16 | 17 | openDialog() { 18 | let dialogRef = this.dialog.open(DialogExampleComponent, { data: { name: 'Vishwas' } }) 19 | dialogRef.afterClosed().subscribe(result => { 20 | console.log(`Dialog result: ${result}`); 21 | }); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /material-demo/src/app/expansion-panel/expansion-panel.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/expansion-panel/expansion-panel.component.css -------------------------------------------------------------------------------- /material-demo/src/app/expansion-panel/expansion-panel.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Angular Fundamentals 5 | Total Duration : 3 hours 6 | 7 |

This is the panel content. Add course details.

8 | 9 |
10 | 11 | 12 | 13 | Angular Material 14 | Total Duration : 2 hours 15 | 16 |

This is the panel content. Add course details.

17 | 18 |
19 |
20 | -------------------------------------------------------------------------------- /material-demo/src/app/expansion-panel/expansion-panel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-expansion-panel', 5 | templateUrl: './expansion-panel.component.html', 6 | styleUrls: ['./expansion-panel.component.css'] 7 | }) 8 | export class ExpansionPanelComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/grid-list/grid-list.component.css: -------------------------------------------------------------------------------- 1 | mat-grid-tile { 2 | background: lightblue; 3 | } 4 | -------------------------------------------------------------------------------- /material-demo/src/app/grid-list/grid-list.component.html: -------------------------------------------------------------------------------- 1 | 2 | Tile 1 3 | Tile 2 4 | Tile 3 5 | Tile 4 6 | 7 | -------------------------------------------------------------------------------- /material-demo/src/app/grid-list/grid-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-grid-list', 5 | templateUrl: './grid-list.component.html', 6 | styleUrls: ['./grid-list.component.css'] 7 | }) 8 | export class GridListComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/icons/icons.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/icons/icons.component.css -------------------------------------------------------------------------------- /material-demo/src/app/icons/icons.component.html: -------------------------------------------------------------------------------- 1 | account_box 2 | -------------------------------------------------------------------------------- /material-demo/src/app/icons/icons.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-icons', 5 | templateUrl: './icons.component.html', 6 | styleUrls: ['./icons.component.css'] 7 | }) 8 | export class IconsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/input/input.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/input/input.component.css -------------------------------------------------------------------------------- /material-demo/src/app/input/input.component.html: -------------------------------------------------------------------------------- 1 | 2 | Name 3 | 4 | Min 5 characters 5 | 6 |
7 | 8 | Name 9 | 10 | Min 5 characters 11 | 12 |
13 | 14 | Name 15 | 16 | Min 5 characters 17 | 18 |
19 | 20 | Name 21 | 22 | Min 5 characters 23 | 24 | -------------------------------------------------------------------------------- /material-demo/src/app/input/input.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-input', 5 | templateUrl: './input.component.html', 6 | styleUrls: ['./input.component.css'] 7 | }) 8 | export class InputComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/list/list.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/list/list.component.css -------------------------------------------------------------------------------- /material-demo/src/app/list/list.component.html: -------------------------------------------------------------------------------- 1 | 2 | Item 1 3 | Item 2 4 | Item 3 5 | 6 | 7 | 8 | Item 1 9 | Item 2 10 | Item 3 11 | 12 | 13 | 14 | Home 15 | About 16 | Services 17 | 18 | 19 | 20 | 21 | home 22 |

Heading 1

23 |

24 | Line 1 25 |

26 |
27 | 28 | 29 | folder 30 |

Heading 2

31 |

32 | Line 1 33 | Line 2 34 |

35 |
36 |
37 | -------------------------------------------------------------------------------- /material-demo/src/app/list/list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-list', 5 | templateUrl: './list.component.html', 6 | styleUrls: ['./list.component.css'] 7 | }) 8 | export class ListComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/material/material.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { 3 | MatButtonModule, 4 | MatButtonToggleModule, 5 | MatBadgeModule, 6 | MatIconModule, 7 | MatProgressSpinnerModule, 8 | MatToolbarModule, 9 | MatSidenavModule, 10 | MatMenuModule, 11 | MatListModule, 12 | MatDividerModule, 13 | MatGridListModule, 14 | MatExpansionModule, 15 | MatTabsModule, 16 | MatCardModule, 17 | MatStepperModule, 18 | MatFormFieldModule, 19 | MatInputModule, 20 | MatSelectModule, 21 | MatAutocompleteModule, 22 | MatCheckboxModule, 23 | MatRadioModule, 24 | MatDatepickerModule, 25 | MatNativeDateModule, 26 | MatTooltipModule, 27 | MatSnackBarModule, 28 | MatDialogModule, 29 | MatTableModule, 30 | MatSortModule, 31 | MatPaginatorModule 32 | } from '@angular/material'; 33 | 34 | const Material = [ 35 | MatButtonModule, 36 | MatButtonToggleModule, 37 | MatBadgeModule, 38 | MatIconModule, 39 | MatProgressSpinnerModule, 40 | MatToolbarModule, 41 | MatSidenavModule, 42 | MatMenuModule, 43 | MatListModule, 44 | MatDividerModule, 45 | MatGridListModule, 46 | MatExpansionModule, 47 | MatTabsModule, 48 | MatCardModule, 49 | MatStepperModule, 50 | MatFormFieldModule, 51 | MatInputModule, 52 | MatSelectModule, 53 | MatAutocompleteModule, 54 | MatCheckboxModule, 55 | MatRadioModule, 56 | MatDatepickerModule, 57 | MatNativeDateModule, 58 | MatTooltipModule, 59 | MatSnackBarModule, 60 | MatDialogModule, 61 | MatTableModule, 62 | MatSortModule, 63 | MatPaginatorModule 64 | ]; 65 | 66 | @NgModule({ 67 | imports: [Material], 68 | exports: [Material] 69 | }) 70 | export class MaterialModule {} 71 | -------------------------------------------------------------------------------- /material-demo/src/app/menu/menu.component.css: -------------------------------------------------------------------------------- 1 | .center { 2 | margin: 10rem; 3 | } 4 | -------------------------------------------------------------------------------- /material-demo/src/app/menu/menu.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 29 |
30 | 33 | -------------------------------------------------------------------------------- /material-demo/src/app/menu/menu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-menu', 5 | templateUrl: './menu.component.html', 6 | styleUrls: ['./menu.component.css'] 7 | }) 8 | export class MenuComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/progress-spinner/progress-spinner.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/progress-spinner/progress-spinner.component.css -------------------------------------------------------------------------------- /material-demo/src/app/progress-spinner/progress-spinner.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /material-demo/src/app/progress-spinner/progress-spinner.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-progress-spinner', 5 | templateUrl: './progress-spinner.component.html', 6 | styleUrls: ['./progress-spinner.component.css'] 7 | }) 8 | export class ProgressSpinnerComponent implements OnInit { 9 | showSpinner = false; 10 | constructor() {} 11 | 12 | ngOnInit() {} 13 | 14 | loadData() { 15 | this.showSpinner = true; 16 | setTimeout(() => { 17 | this.showSpinner = false; 18 | }, 5000); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /material-demo/src/app/radiobutton/radiobutton.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/radiobutton/radiobutton.component.css -------------------------------------------------------------------------------- /material-demo/src/app/radiobutton/radiobutton.component.html: -------------------------------------------------------------------------------- 1 | 2 | Angular 3 | React 4 | Vue 5 | 6 | -------------------------------------------------------------------------------- /material-demo/src/app/radiobutton/radiobutton.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-radiobutton', 5 | templateUrl: './radiobutton.component.html', 6 | styleUrls: ['./radiobutton.component.css'] 7 | }) 8 | export class RadiobuttonComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/select/select.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/select/select.component.css -------------------------------------------------------------------------------- /material-demo/src/app/select/select.component.html: -------------------------------------------------------------------------------- 1 | 2 | Topic 3 | 4 | None 5 | 6 | Angular 7 | React 8 | Vue 9 | 10 | 11 | Ionic 12 | React Native 13 | 14 | 15 | 16 | {{selectedValue}} 17 | -------------------------------------------------------------------------------- /material-demo/src/app/select/select.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-select', 5 | templateUrl: './select.component.html', 6 | styleUrls: ['./select.component.css'] 7 | }) 8 | export class SelectComponent implements OnInit { 9 | 10 | selectedValue: string; 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /material-demo/src/app/sidenav/sidenav.component.css: -------------------------------------------------------------------------------- 1 | mat-sidenav-container { 2 | height: 100%; 3 | } 4 | 5 | mat-sidenav, mat-sidenav-content { 6 | padding: 16px; 7 | } 8 | 9 | mat-sidenav { 10 | background-color: lightcoral; 11 | width: 200px; 12 | } 13 | -------------------------------------------------------------------------------- /material-demo/src/app/sidenav/sidenav.component.html: -------------------------------------------------------------------------------- 1 | 2 | Sidenav 3 | 4 | Main - 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /material-demo/src/app/sidenav/sidenav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-sidenav', 5 | templateUrl: './sidenav.component.html', 6 | styleUrls: ['./sidenav.component.css'] 7 | }) 8 | export class SidenavComponent { 9 | 10 | opened = false; 11 | 12 | log(state) { 13 | console.log(state) 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /material-demo/src/app/snackbar/snackbar.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/snackbar/snackbar.component.css -------------------------------------------------------------------------------- /material-demo/src/app/snackbar/snackbar.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /material-demo/src/app/snackbar/snackbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MatSnackBar } from '@angular/material'; 3 | 4 | @Component({ 5 | selector: 'app-snackbar', 6 | templateUrl: './snackbar.component.html', 7 | styleUrls: ['./snackbar.component.css'] 8 | }) 9 | export class SnackbarComponent implements OnInit { 10 | 11 | constructor(private snackBar: MatSnackBar) {} 12 | 13 | ngOnInit() { 14 | } 15 | 16 | openSnackBar(message, action) { 17 | let snackBarRef = this.snackBar.open(message, action, {duration: 2000}); 18 | 19 | snackBarRef.afterDismissed().subscribe(() => { 20 | console.log('The snack-bar was dismissed'); 21 | }); 22 | 23 | snackBarRef.onAction().subscribe(() => { 24 | console.log('The snack-bar action was triggered!'); 25 | }); 26 | } 27 | 28 | openCustomSnackBar() { 29 | this.snackBar.openFromComponent(CustomSnackBarComponent, {duration: 2000}) 30 | } 31 | } 32 | 33 | @Component({ 34 | selector: 'custom-snackbar', 35 | template: `Custom Snackbar` 36 | }) 37 | export class CustomSnackBarComponent {} 38 | -------------------------------------------------------------------------------- /material-demo/src/app/stepper/stepper.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/stepper/stepper.component.css -------------------------------------------------------------------------------- /material-demo/src/app/stepper/stepper.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Shipping Address Details

4 |
5 | 6 |

Billing Address Details

7 |
8 | 9 | 10 |
11 |
12 | 13 |

Order Details

14 |
15 |
16 | -------------------------------------------------------------------------------- /material-demo/src/app/stepper/stepper.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-stepper', 5 | templateUrl: './stepper.component.html', 6 | styleUrls: ['./stepper.component.css'] 7 | }) 8 | export class StepperComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/tabs/tabs.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/tabs/tabs.component.css -------------------------------------------------------------------------------- /material-demo/src/app/tabs/tabs.component.html: -------------------------------------------------------------------------------- 1 | 2 | Angular Content 3 | React Content 4 | Vue Content 5 | 6 | {{tabRef.selectedIndex}} 7 | -------------------------------------------------------------------------------- /material-demo/src/app/tabs/tabs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-tabs', 5 | templateUrl: './tabs.component.html', 6 | styleUrls: ['./tabs.component.css'] 7 | }) 8 | export class TabsComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | logChange(index) { 15 | console.log(index); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /material-demo/src/app/toolbar/toolbar.component.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | justify-content: space-between; 3 | flex-wrap: wrap; 4 | } 5 | 6 | span { 7 | padding-right: 1rem; 8 | } 9 | -------------------------------------------------------------------------------- /material-demo/src/app/toolbar/toolbar.component.html: -------------------------------------------------------------------------------- 1 | 2 |
Codevolution
3 |
4 | Home 5 | About 6 | Services 7 |
8 |
9 | -------------------------------------------------------------------------------- /material-demo/src/app/toolbar/toolbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-toolbar', 5 | templateUrl: './toolbar.component.html', 6 | styleUrls: ['./toolbar.component.css'] 7 | }) 8 | export class ToolbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/tooltip/tooltip.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/tooltip/tooltip.component.css -------------------------------------------------------------------------------- /material-demo/src/app/tooltip/tooltip.component.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /material-demo/src/app/tooltip/tooltip.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-tooltip', 5 | templateUrl: './tooltip.component.html', 6 | styleUrls: ['./tooltip.component.css'] 7 | }) 8 | export class TooltipComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/typography/typography.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/app/typography/typography.component.css -------------------------------------------------------------------------------- /material-demo/src/app/typography/typography.component.html: -------------------------------------------------------------------------------- 1 |
This is a heading for h1
2 |
This is a heading for h2
3 |
This is a heading for h3
4 |
This is a heading for h4
5 |
This is display 4
6 |
This is display 3
7 |
This is display 2
8 |
This is display 1
9 |
This is body text
10 |
This is bold body text
11 |
This is caption text
12 |
13 |

This is a heading for h1

14 |

This is a heading for h2

15 |

This is a heading for h3

16 |

This is a heading for h4

17 |
18 | -------------------------------------------------------------------------------- /material-demo/src/app/typography/typography.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-typography', 5 | templateUrl: './typography.component.html', 6 | styleUrls: ['./typography.component.css'] 7 | }) 8 | export class TypographyComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /material-demo/src/app/virtual-scrolling/virtual-scrolling.component.css: -------------------------------------------------------------------------------- 1 | .number { 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | border: 2px solid maroon; 6 | height: 100px; 7 | box-sizing: border-box; 8 | } 9 | 10 | .container { 11 | height: 400px; 12 | } 13 | -------------------------------------------------------------------------------- /material-demo/src/app/virtual-scrolling/virtual-scrolling.component.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | {{number}} 7 |
8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /material-demo/src/app/virtual-scrolling/virtual-scrolling.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-virtual-scrolling', 5 | templateUrl: './virtual-scrolling.component.html', 6 | styleUrls: ['./virtual-scrolling.component.css'] 7 | }) 8 | export class VirtualScrollingComponent implements OnInit { 9 | 10 | numbers = []; 11 | 12 | constructor() { 13 | for (let i = 0; i < 1000; i++) { 14 | this.numbers.push(i) 15 | } 16 | } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /material-demo/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/assets/.gitkeep -------------------------------------------------------------------------------- /material-demo/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /material-demo/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /material-demo/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, for easier debugging, you can ignore zone related error 11 | * stack frames such as `zone.run`/`zoneDelegate.invokeTask` by importing the 12 | * below file. Don't forget to comment it out in production mode 13 | * because it will have a performance impact when errors are thrown 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /material-demo/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gopinav/Angular-Material-Tutorial/9bd88920e131d7f8ea79df4bb58d1b3a243ced53/material-demo/src/favicon.ico -------------------------------------------------------------------------------- /material-demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MaterialDemo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /material-demo/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /material-demo/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /material-demo/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /material-demo/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 2rem; font-family: 'Roboto', sans-serif; } 5 | -------------------------------------------------------------------------------- /material-demo/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /material-demo/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "src/test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /material-demo/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /material-demo/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /material-demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "importHelpers": true, 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "module": "es2015", 10 | "moduleResolution": "node", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2017", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /material-demo/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | --------------------------------------------------------------------------------