import { Component , ViewEncapsulation } from '@angular/core' ; import { Modal , JSNativeModalModule , providers } from 'ngx-modialog/plugins/js-native' ; import { ModalCommandDescriptor } from '../demo-head/index' ; import * as presets from './presets' ; @ Component ( { selector : 'js-native-demo' , templateUrl : './js-native-demo.tpl.html' , providers : providers , encapsulation : ViewEncapsulation . None } ) export class JSNativeDemo { public modalCommands : ModalCommandDescriptor [ ] ; constructor ( public modal ) { this . modalCommands = [ 'alert' , 'prompt' , 'confirm' ] . map ( dropin => { return { text : `${ dropin } drop in` , factory : ( ) => presets [ dropin ] ( this . modal ) . open ( ) } ; } ) ; } }