-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Integration with AngularMaterial2
Praveen Kumar Pendyala edited this page Jun 11, 2017
·
23 revisions
npm install --save @angular/material
this.NPM_DEPENDENCIES = [
...this.NPM_DEPENDENCIES,
/* Select a pre-built Material theme */
{src: '@angular/material/prebuilt-themes/indigo-pink.css', inject: true}
];
this.addPackageBundles({
name:'@angular/material',
path:'node_modules/@angular/material/bundles/material.umd.js',
packageMeta:{
//@michelcve: I believe the next line should be removed, can someone confirm this?
//main: 'index.js',
defaultExtension: 'js'
}
});
import { MaterialModule } from '@angular/material';
// other imports
@NgModule({
imports: [ MaterialModule ],
...
})
export class FooAppModule { }
- Add
import { MdToolbarModule } from '@angular/material';
inabout.module.ts
- Add
MdToolbarModule
to NgModule imports inabout.module.ts
- Add HTML element:
<md-toolbar color="primary">My App</md-toolbar>
inabout.html
- Fix tests: add
MaterialModule
to imports ofTestBed.configureTestingModule
inabout.component.spec.ts