材料2 sidenav不能正常工作。 css没有显示

时间:2016-07-26 04:47:39

标签: angular angular2-material

enter image description here Angular2材料复选框,工具栏,nd按钮组件随css一起显示。但sidenav没有用css显示。上面提供的图片。

来自

的代码
  

https://www.npmjs.com/package/@angular2-material/sidenav

  <md-sidenav-layout fullscreen>
    <md-sidenav #start (open)="mybutton.focus()">
        Start Sidenav.
        <br>
        <button md-button #mybutton (click)="start.close()">Close</button>
    </md-sidenav>
    <md-sidenav #end align="end">
        End Sidenav.
        <button md-button (click)="end.close()">Close</button>
    </md-sidenav>

    My regular content. This will be moved into the proper DOM at runtime.
</md-sidenav-layout>

    My regular content. This will be moved into the proper DOM at runtime.
</md-sidenav-layout>

组件文件

import { Component } from "@angular/core";
import { MdSidenav } from '@angular2-material/sidenav';
import { MdCheckbox } from '@angular2-material/checkbox';
import { MdButton } from '@angular2-material/button';
import { MdToolbar } from '@angular2-material/toolbar';

@Component({
    selector: "my-sidebar",
    templateUrl: "app/sidebar.component.html",
    directives: [MdCheckbox, MdSidenav, MdButton, MdToolbar]
})
export class SidebarComponent {

}

0 个答案:

没有答案