0.0.297 • Published 7 years ago

mz-modal-window v0.0.297

Weekly downloads
60
License
-
Repository
-
Last release
7 years ago
Установка
npm i mz-modal-window --save
Подключение к модулю
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    // import our module
    MzModalWindowModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {
}
Добавление в шаблон
    <app-modal-window>
        <router-outlet></router-outlet>
        <right-big-panel></right-big-panel>
    </app-modal-window>
Inject в компонент
export class SomeComponent {
  constructor(
        private mzModalWindowService: MzModalWindowService,
  ) {
  
  }
  
  showPanel () {
      this.mzModalWindowService.open(
          AnyComponentForPanel,
          {
              // add hide panel
              hidePanel: this.hidePanel.bind(this),
              // add any @Input data to component
              roleId: -1,
              roleName: '',
              image: '',
              entities: JSON.parse(JSON.stringify(this.emptyRole.entities))
          },
          //TODO later delete, set diference of create and edit
          'id1', // this.panelId
      );
  }
  
  /*
  * hide panel
  * */
  hidePanel () {
      //TODO later delete, set diference of create and edit
      this.mzModalWindowService.close('id1'); // this.panelId
  }
}
0.0.297

7 years ago

0.0.296

7 years ago

0.0.295

7 years ago

0.0.294

7 years ago

0.0.293

7 years ago

0.0.292

7 years ago

0.0.291

7 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.25

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.2

7 years ago