角度材质2不渲染组件的样式

时间:2017-10-04 04:29:37

标签: angular angular-material2

我正在尝试在我的项目中使用最新版本的角度材料,并遵循官方网站的说明。 显然,materialmodule不再是其中的一部分了,包括它在我的项目中最初给了我编译器错误。 我已经单独导入了所需的模块,但样式不会在屏幕上呈现。 我错过了什么?

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatButtonModule,MatSidenavModule,MatMenuModule,
  MatToolbarModule,MatCheckboxModule,MatSelectModule, MatListModule,MatButtonToggleModule,MatTableModule
} from '@angular/material';

@NgModule({
...
  imports: [
    InMemoryWebApiModule.forRoot(MockData),
    AppRoutingModule,
    FormsModule,
    HttpModule,
    BrowserModule,
    BrowserAnimationsModule,
    MatButtonModule,
    MatSidenavModule,
    MatMenuModule,
    MatToolbarModule,
    MatCheckboxModule,
    MatSelectModule,
    MatListModule,
    MatButtonToggleModule,
    MatTableModule
  ],

Resource.component.html

<md-sidenav-container class="ui-container">
  <md-sidenav #sidenav class="ui-sidenav">
  Jolly good
    </md-sidenav>

      <div class="sidenav-content">
        <button type="button" md-button (click)="sidenav.open()">
          Open Selection Menu
        </button>
      </div>

</md-sidenav-container>

的package.json

 "dependencies": {
    "@angular/animations": "^4.4.4",
    "@angular/cdk": "github:angular/cdk-builds",
    "@angular/common": "^4.4.4",
    "@angular/compiler": "^4.2.4",
    "@angular/compiler-cli": "^4.4.4",
    "@angular/core": "^4.4.4",
    "@angular/forms": "^4.4.4",
    "@angular/http": "^4.4.4",
    "@angular/material": "github:angular/material2-builds",
    "@angular/platform-browser": "^4.4.4",
    "@angular/platform-browser-dynamic": "^4.4.4",
    "@angular/platform-server": "^4.4.4",
    "@angular/router": "^4.4.4",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.4.2",
    "typescript": "^2.5.3",
    "zone.js": "^0.8.14"
  },

当前输出

0 个答案:

没有答案