@dev-monster/ionic-angular-controller
TypeScript icon, indicating that this package has built-in type declarations

0.0.28 • Public • Published

@dev-monster/ionic-angualr-controller

This library is expansions of ionic4 controllers. ion-alert, ion-modal, ion-popover and ion-toast.

main functions

  • Web browsers & android back button : Controllers can be dismissed by press backbutton on browsers and android.

  • IE browser design fix : IE11's ToastControllers position and animation fix.

It is unstable expansion. So use carefully.

install

npm install --save @dev-monster/ionic-angualr-controller

Usage

app.module.ts

import { MonIonControllerModule } from '@dev-monster/ionic-angular-controller';

@NgModule({
  ...
  imports: [
    ...
    MonIonControllerModule
    ...
    ],
  ...
})
export class AppModule {}

and then any page's modult.ts to use this controllers. These are allmost same usage as ion-alert, ion-modal, ion-popover and ion-toast.

monster-alert-controller

import { MonAlertController } from '@dev-monster/ionic-angular-controller';

export class HomePage implements OnInit {
  constructor(
    private alertCtrl: MonAlertController
  ) { }

  async ngOnInit() {
    const alert = await this.alertCtrl.create({
      header: `Monster Ionic Alert`,
      message: 'It is Monster Ionic Alert',
      buttons: [
        {
          text: 'cancel'
        },
        {
          text: 'close alertcontroller',
          handler: () => {
            this.alertCtrl.dismiss();
            return false;
          }
        },
        {
          text: 'close this alert',
          handler: () => {
            alert.dismiss();
            return false;
          }
        },
        {
          text: 'open one more',
          handler: () => {
            this.openAlert();
            return false;
          }
        }
      ]
    });
    await alert.present();
  }
}

monster-modal-controller

import { MonAlertController } from '@dev-monster/ionic-angular-controller';

export class HomePage implements OnInit {
  constructor(
    private alertCtrl: MonAlertController
  ) { }

  async ngOnInit() {
    const modal = await this.modalCtrl.create({
      component: ModalSampleComponent
    });
    await modal.present();
  }
}

monster-popover-controller

import { MonAlertController } from '@dev-monster/ionic-angular-controller';

export class HomePage implements OnInit {
  constructor(
    private alertCtrl: MonAlertController
  ) { }

  async ngOnInit() {
    const popover = await this.popoverCtrl.create({
      component: PopoverSampleComponent,
      event: ev
    });
    await popover.present();
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.281latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.281
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i @dev-monster/ionic-angular-controller

Weekly Downloads

0

Version

0.0.28

License

ISC

Unpacked Size

286 kB

Total Files

36

Last publish

Collaborators

  • hongd