Hello I am using JHipster 4.0.1
I want integrate angular 2 material into my home.component.
I did : npm install material npm install angular2/{core,button}
<html><head></head>
<body>
<md-button>Hello </md-button></body></html>
the error is : md-button is not a known element
For those using yarn rather than npm:
yarn add --exact @angular/material
yarn start
Import angular material module into src/main/webapp/app/shared/shared-libs.module.ts
:
import { MaterialModule } from '@angular/material';
@NgModule({
imports: [
MaterialModule,
... ],
exports: [
MaterialModule,
...
Add a theme into src/main/webapp/content/css/vendor.css
:
@import '~@angular/material/core/theming/prebuilt/deeppurple-amber.css';
Add some MD elements to src/main/webapp/app/home.component.html
:
<md-card>
<button md-button class="mat-primary">Hello </button>
</md-card>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With