mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(overlay): actionsheet/popup
This commit is contained in:
@@ -4,6 +4,7 @@ import {ROUTER_BINDINGS, HashLocationStrategy, LocationStrategy} from 'angular2/
|
||||
import {IonicApp} from '../components/app/app';
|
||||
import {IonicConfig} from './config';
|
||||
import {IonicPlatform} from '../platform/platform';
|
||||
import {OverlayController} from '../components/overlay/overlay-controller';
|
||||
import {ActionSheet} from '../components/action-sheet/action-sheet';
|
||||
import {Modal} from '../components/modal/modal';
|
||||
import {Popup} from '../components/popup/popup';
|
||||
@@ -40,6 +41,7 @@ export function ionicBindings(configSettings) {
|
||||
bind(IonicPlatform).toValue(platform),
|
||||
bind(TapClick).toValue(tapClick),
|
||||
bind(Events).toValue(events),
|
||||
OverlayController,
|
||||
ActionSheet,
|
||||
Modal,
|
||||
Popup,
|
||||
|
||||
@@ -49,13 +49,17 @@ export function IonicDirective(config) {
|
||||
*/
|
||||
export function IonicComponent(config) {
|
||||
return function(cls) {
|
||||
var annotations = Reflect.getMetadata('annotations', cls) || [];
|
||||
annotations.push(new Component(appendConfig(cls, config)));
|
||||
Reflect.defineMetadata('annotations', annotations, cls);
|
||||
return cls;
|
||||
return makeComponent(cls, appendConfig(cls, config));
|
||||
}
|
||||
}
|
||||
|
||||
export function makeComponent(cls, config) {
|
||||
var annotations = Reflect.getMetadata('annotations', cls) || [];
|
||||
annotations.push(new Component(config));
|
||||
Reflect.defineMetadata('annotations', annotations, cls);
|
||||
return cls;
|
||||
}
|
||||
|
||||
function appendConfig(cls, config) {
|
||||
config.host = config.host || {};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {CORE_DIRECTIVES, FORM_DIRECTIVES, forwardRef} from 'angular2/angular2'
|
||||
|
||||
import {
|
||||
OverlayAnchor,
|
||||
Menu, MenuToggle, MenuClose,
|
||||
Button, Content, Scroll, Refresher,
|
||||
Slides, Slide, SlideLazy,
|
||||
@@ -29,6 +30,7 @@ export const IONIC_DIRECTIVES = [
|
||||
FORM_DIRECTIVES,
|
||||
|
||||
// Content
|
||||
forwardRef(() => OverlayAnchor),
|
||||
forwardRef(() => Menu),
|
||||
forwardRef(() => MenuToggle),
|
||||
forwardRef(() => MenuClose),
|
||||
|
||||
Reference in New Issue
Block a user