mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
chore(components): ngmodule updates
This commit is contained in:
@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
import { App } from '../app/app';
|
||||
import { isPresent } from '../../util/util';
|
||||
import { NavOptions } from '../nav/nav-interfaces';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { PopoverCmp } from './popover-component';
|
||||
import { PopoverOptions } from './popover-options';
|
||||
import { ViewController } from '../nav/view-controller';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
@ -14,20 +14,15 @@ import { ViewController } from '../nav/view-controller';
|
||||
export class Popover extends ViewController {
|
||||
private _app: App;
|
||||
|
||||
constructor(app: App, componentType: any, data: any = {}, opts: PopoverOptions = {}) {
|
||||
constructor(app: App, component: any, data: any = {}, opts: PopoverOptions = {}) {
|
||||
opts.showBackdrop = isPresent(opts.showBackdrop) ? !!opts.showBackdrop : true;
|
||||
opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
|
||||
|
||||
data.componentType = componentType;
|
||||
data.component = component;
|
||||
data.opts = opts;
|
||||
super(PopoverCmp, data);
|
||||
super(PopoverCmp, data, null);
|
||||
this._app = app;
|
||||
this.isOverlay = true;
|
||||
|
||||
// by default, popovers should not fire lifecycle events of other views
|
||||
// for example, when a popover enters, the current active view should
|
||||
// not fire its lifecycle events because it's not conceptually leaving
|
||||
this.fireOtherLifecycles = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +47,7 @@ export class Popover extends ViewController {
|
||||
* @private
|
||||
* DEPRECATED: Please inject PopoverController instead
|
||||
*/
|
||||
static create(componentType: any, data = {}, opts: PopoverOptions = {}) {
|
||||
static create(component: any, data = {}, opts: PopoverOptions = {}) {
|
||||
// deprecated warning: added beta.11 2016-06-27
|
||||
console.warn('Popover.create(..) has been deprecated. Please inject PopoverController instead');
|
||||
}
|
||||
@ -110,7 +105,7 @@ export class Popover extends ViewController {
|
||||
* ```ts
|
||||
* @Component({})
|
||||
* class MyPage {
|
||||
* constructor(private popoverCtrl: PopoverController) {}
|
||||
* constructor(public popoverCtrl: PopoverController) {}
|
||||
*
|
||||
* presentPopover(myEvent) {
|
||||
* let popover = this.popoverCtrl.create(PopoverPage);
|
||||
@ -138,7 +133,7 @@ export class Popover extends ViewController {
|
||||
* `
|
||||
* })
|
||||
* class PopoverPage {
|
||||
* constructor(private viewCtrl: ViewController) {}
|
||||
* constructor(public viewCtrl: ViewController) {}
|
||||
*
|
||||
* close() {
|
||||
* this.viewCtrl.dismiss();
|
||||
@ -165,12 +160,12 @@ export class PopoverController {
|
||||
|
||||
/**
|
||||
* Present a popover. See below for options
|
||||
* @param {object} componentType The Popover
|
||||
* @param {object} component The Popover
|
||||
* @param {object} data Any data to pass to the Popover view
|
||||
* @param {PopoverOptions} opts Popover options
|
||||
*/
|
||||
create(componentType: any, data = {}, opts: PopoverOptions = {}): Popover {
|
||||
return new Popover(this._app, componentType, data, opts);
|
||||
create(component: any, data = {}, opts: PopoverOptions = {}): Popover {
|
||||
return new Popover(this._app, component, data, opts);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user