在开发模式下预览组件使用
yarn add iwe7-books
import { BooksModule } from "iwe7-books";
@NgModule({
imports: [BooksModule],
})
<app-books [modules]="modules"></app-books>
- 案例,查看material2模块组件
import { Component, Compiler } from "@angular/core";
import {
MatCardModule,
MatMenuModule,
MatButtonModule,
MatOptionModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonToggleModule,
MatCheckboxModule,
MatChipsModule,
MatCommonModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatFormFieldModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatLineModule,
MatListModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatPseudoCheckboxModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatStepperModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
NativeDateModule
} from "@angular/material";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent {
title = "app";
modules: any[] = [
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatCommonModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatFormFieldModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatLineModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatOptionModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatPseudoCheckboxModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatStepperModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
NativeDateModule
];
constructor(public compiler: Compiler) {
}
}