mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
overlay/bootstrap refactor
This commit is contained in:
@ -8,15 +8,15 @@
|
|||||||
|
|
||||||
import {NgIf, NgFor} from 'angular2/angular2';
|
import {NgIf, NgFor} from 'angular2/angular2';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
|
import {Injectable} from 'angular2/di';
|
||||||
|
|
||||||
import {Item, Icon} from 'ionic/ionic';
|
import {Icon} from 'ionic/ionic';
|
||||||
import {IonicRoot} from '../app/app';
|
import {IonicApp} from '../app/app';
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
|
|
||||||
import {Overlay} from '../overlay/overlay';
|
import {Overlay} from '../overlay/overlay';
|
||||||
import {IonicComponent} from '../../config/component';
|
import {IonicComponent} from '../../config/component';
|
||||||
import {Animation} from 'ionic/animations/animation';
|
import {Animation} from 'ionic/animations/animation';
|
||||||
import {ClickBlock} from '../../util/click-block';
|
|
||||||
|
|
||||||
|
|
||||||
@IonicComponent(ActionMenu)
|
@IonicComponent(ActionMenu)
|
||||||
@ -35,8 +35,9 @@ import {ClickBlock} from '../../util/click-block';
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`,
|
</div>`,
|
||||||
directives: [Item, Icon, NgIf, NgFor]
|
directives: [Icon, NgIf, NgFor]
|
||||||
})
|
})
|
||||||
|
@Injectable()
|
||||||
export class ActionMenu extends Overlay {
|
export class ActionMenu extends Overlay {
|
||||||
|
|
||||||
static get config() {
|
static get config() {
|
||||||
@ -48,8 +49,8 @@ export class ActionMenu extends Overlay {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor(app: IonicApp) {
|
||||||
super();
|
super(app);
|
||||||
|
|
||||||
this.extendOptions({
|
this.extendOptions({
|
||||||
destructiveButtonClicked: util.noop,
|
destructiveButtonClicked: util.noop,
|
||||||
@ -85,17 +86,17 @@ export class ActionMenu extends Overlay {
|
|||||||
*
|
*
|
||||||
* @return Promise that resolves when the action menu is open.
|
* @return Promise that resolves when the action menu is open.
|
||||||
*/
|
*/
|
||||||
static open(opts) {
|
open(opts) {
|
||||||
return this.create(overlayType, ActionMenu, opts);
|
return this.create(OVERLAY_TYPE, ActionMenu, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static get() {
|
get() {
|
||||||
return Modal.getByType(overlayType);
|
return Modal.getByType(OVERLAY_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const overlayType = 'actionmenu';
|
const OVERLAY_TYPE = 'actionmenu';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,15 +4,22 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
import {ActionMenu} from 'ionic/components/action-menu/action-menu';
|
import {ActionMenu} from 'ionic/components/action-menu/action-menu';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({
|
||||||
|
selector: 'ion-app',
|
||||||
|
appInjector: [ActionMenu]
|
||||||
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class IonicApp {
|
class IonicApp {
|
||||||
|
|
||||||
|
constructor(ActionMenu: ActionMenu) {
|
||||||
|
this.ActionMenu = ActionMenu;
|
||||||
|
}
|
||||||
|
|
||||||
openMenu() {
|
openMenu() {
|
||||||
|
|
||||||
ActionMenu.open({
|
this.ActionMenu.open({
|
||||||
buttons: [
|
buttons: [
|
||||||
{ text: 'Share This' },
|
{ text: 'Share This' },
|
||||||
{ text: 'Move' }
|
{ text: 'Move' }
|
||||||
@ -31,6 +38,7 @@ class IonicApp {
|
|||||||
if(index == 1) { return false; }
|
if(index == 1) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}).then(actionMenu => {
|
}).then(actionMenu => {
|
||||||
this.actionMenu = actionMenu;
|
this.actionMenu = actionMenu;
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {bootstrap} from 'angular2/angular2';
|
import {bootstrap} from 'angular2/angular2';
|
||||||
|
import {AppViewManager} from 'angular2/src/core/compiler/view_manager';
|
||||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
import {ComponentRef, onDestroy, DomRenderer, ApplicationRef} from 'angular2/angular2';
|
import {ComponentRef, onDestroy, DomRenderer, ApplicationRef} from 'angular2/angular2';
|
||||||
@ -17,57 +18,84 @@ import {IonicConfig} from '../../config/config';
|
|||||||
import {ViewController} from '../view/view-controller';
|
import {ViewController} from '../view/view-controller';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
export class IonicApp {
|
||||||
selector: 'ionic'
|
|
||||||
})
|
|
||||||
@View({
|
|
||||||
template: '<template pane-anchor></template>',
|
|
||||||
directives: [PaneAnchor]
|
|
||||||
})
|
|
||||||
class IonicRootComponent extends ViewController {
|
|
||||||
constructor(
|
|
||||||
compiler: Compiler,
|
|
||||||
elementRef: ElementRef,
|
|
||||||
loader: DynamicComponentLoader,
|
|
||||||
parentInjector: Injector
|
|
||||||
) {
|
|
||||||
let injector = parentInjector;
|
|
||||||
let ComponentType = null;
|
|
||||||
|
|
||||||
if (appModules.length) {
|
constructor() {
|
||||||
ComponentType = appModules.shift();
|
this.overlays = [];
|
||||||
|
|
||||||
injector = parentInjector.resolveAndCreateChild([
|
|
||||||
bind(IonicConfig).toValue(ComponentType._config)
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super(null, compiler, elementRef, loader, injector);
|
/**
|
||||||
IonicRoot.component(this);
|
* Create and append the given component into the root
|
||||||
|
* element of the app.
|
||||||
|
*
|
||||||
|
* @param Component the ComponentType to create and insert
|
||||||
|
* @return Promise that resolves with the ContainerRef created
|
||||||
|
*/
|
||||||
|
appendComponent(ComponentType: Type) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let injector = this._ref.injector;
|
||||||
|
let compiler = injector.get(Compiler);
|
||||||
|
let viewMngr = injector.get(AppViewManager);
|
||||||
|
let rootComponentRef = this._ref._hostComponent;
|
||||||
|
let viewContainerLocation = rootComponentRef.location;
|
||||||
|
|
||||||
if (ComponentType) {
|
compiler.compileInHost(ComponentType).then(protoViewRef => {
|
||||||
this.push(ComponentType);
|
|
||||||
|
let atIndex = 0;
|
||||||
|
let context = null;
|
||||||
|
|
||||||
|
let hostViewRef = viewMngr.createViewInContainer(
|
||||||
|
viewContainerLocation,
|
||||||
|
atIndex,
|
||||||
|
protoViewRef,
|
||||||
|
context,
|
||||||
|
injector);
|
||||||
|
|
||||||
|
hostViewRef.elementRef = new ElementRef(hostViewRef, 0);
|
||||||
|
hostViewRef.instance = viewMngr.getComponent(hostViewRef.elementRef);
|
||||||
|
|
||||||
|
hostViewRef.dispose = () => {
|
||||||
|
viewMngr.destroyViewInContainer(viewContainerLocation, 0, 0, hostViewRef.viewRef);
|
||||||
|
};
|
||||||
|
|
||||||
|
resolve(hostViewRef);
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('IonicApp appendComponent:', err);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ref() {
|
||||||
|
if (arguments.length) {
|
||||||
|
this._ref = arguments[0];
|
||||||
}
|
}
|
||||||
|
return this._ref;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Directive({
|
|
||||||
selector: 'template[pane-anchor]'
|
|
||||||
})
|
|
||||||
class PaneAnchor {
|
|
||||||
constructor(@Parent() rootCmp: IonicRootComponent, elementRef: ElementRef, viewContainerRef: ViewContainerRef) {
|
|
||||||
rootCmp.anchorElementRef(elementRef);
|
|
||||||
rootCmp.anchorViewContainerRef(viewContainerRef);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let appModules = [];
|
|
||||||
|
|
||||||
export function ionicBootstrap(ComponentType, config) {
|
export function ionicBootstrap(ComponentType, config) {
|
||||||
ComponentType._config = config || new IonicConfig();
|
return new Promise((resolve, reject) => {
|
||||||
appModules.push(ComponentType);
|
let app = new IonicApp();
|
||||||
bootstrap(IonicRootComponent);
|
config = config || new IonicConfig();
|
||||||
|
|
||||||
|
let componentInjectableBindings = [
|
||||||
|
bind(IonicApp).toValue(app),
|
||||||
|
bind(IonicConfig).toValue(config)
|
||||||
|
];
|
||||||
|
|
||||||
|
bootstrap(ComponentType, componentInjectableBindings).then(appRef => {
|
||||||
|
app.ref(appRef);
|
||||||
|
resolve(app);
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('ionicBootstrap', err);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function load(app) {
|
export function load(app) {
|
||||||
@ -81,51 +109,3 @@ export function load(app) {
|
|||||||
app.main(ionicBootstrap);
|
app.main(ionicBootstrap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class IonicAppRoot {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create and append the given component into the root
|
|
||||||
* element of the app.
|
|
||||||
*
|
|
||||||
* @param Component the ComponentType to create and insert
|
|
||||||
* @return Promise that resolves with the ContainerRef created
|
|
||||||
*/
|
|
||||||
append(ComponentType: Type) {
|
|
||||||
let rootComponent = this.component();
|
|
||||||
let injector = rootComponent.injector;
|
|
||||||
let loader = rootComponent.loader;
|
|
||||||
let elementRef = rootComponent.anchorElementRef();
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
rootComponent.compiler.compileInHost(ComponentType).then(componentProtoViewRef => {
|
|
||||||
|
|
||||||
let containerRef = rootComponent.anchorViewContainerRef();
|
|
||||||
let hostViewRef = containerRef.create(componentProtoViewRef, -1, null, injector);
|
|
||||||
|
|
||||||
hostViewRef.elementRef = new ElementRef(hostViewRef, 0);
|
|
||||||
hostViewRef.instance = loader._viewManager.getComponent(hostViewRef.elementRef);
|
|
||||||
|
|
||||||
hostViewRef.dispose = () => {
|
|
||||||
containerRef.remove( containerRef.indexOf(hostViewRef) );
|
|
||||||
};
|
|
||||||
|
|
||||||
resolve(hostViewRef);
|
|
||||||
}).catch(err => {
|
|
||||||
console.error('IonicAppRoot append:', err);
|
|
||||||
reject(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
component() {
|
|
||||||
if (arguments.length) {
|
|
||||||
this._cmp = arguments[0];
|
|
||||||
}
|
|
||||||
return this._cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export let IonicRoot = new IonicAppRoot();
|
|
||||||
|
2
ionic/components/app/normalize.scss
vendored
2
ionic/components/app/normalize.scss
vendored
@ -61,7 +61,7 @@ strong {
|
|||||||
|
|
||||||
// Remove border when inside `a` element in IE 8/9/10.
|
// Remove border when inside `a` element in IE 8/9/10.
|
||||||
ion-app img,
|
ion-app img,
|
||||||
ionic img {
|
.ion-app img {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ion-app,
|
ion-app,
|
||||||
ionic {
|
.ion-app {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ html {
|
|||||||
|
|
||||||
|
|
||||||
ion-app,
|
ion-app,
|
||||||
ionic {
|
.ion-app {
|
||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
font-family: $font-family-base;
|
font-family: $font-family-base;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view'
|
selector: 'ion-app'
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -4,7 +4,7 @@ import {FormBuilder, Validators, formDirectives} from 'angular2/forms';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html',
|
templateUrl: 'main.html',
|
||||||
directives: [formDirectives]
|
directives: [formDirectives]
|
||||||
|
@ -4,7 +4,7 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view'
|
selector: 'ion-app'
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
|
@ -4,7 +4,7 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view'
|
selector: 'ion-app'
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
|
@ -3,7 +3,7 @@ import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,7 @@ import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
|||||||
import {Content, List, Item} from 'ionic/ionic';
|
import {Content, List, Item} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@View({
|
@View({
|
||||||
templateUrl: 'main.html',
|
templateUrl: 'main.html',
|
||||||
directives: [Content, List, Item, ItemCellTemplate, NgFor]
|
directives: [Content, List, Item, ItemCellTemplate, NgFor]
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
|
import {Injectable} from 'angular2/di';
|
||||||
|
|
||||||
import {Overlay} from '../overlay/overlay';
|
import {Overlay} from '../overlay/overlay';
|
||||||
import {Animation} from '../../animations/animation';
|
import {Animation} from '../../animations/animation';
|
||||||
|
import {IonicApp} from '../app/app';
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
export class Modal extends Overlay {
|
export class Modal extends Overlay {
|
||||||
|
|
||||||
static get config() {
|
static get config() {
|
||||||
@ -13,26 +17,28 @@ export class Modal extends Overlay {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor(app: IonicApp) {
|
||||||
super();
|
// a modal created by the appInjector will inject an IonicApp
|
||||||
|
// a modal created by the user will not
|
||||||
|
super(app);
|
||||||
|
|
||||||
this.extendOptions({
|
this.extendOptions({
|
||||||
enterAnimation: 'modal-slide-in',
|
enterAnimation: 'modal-slide-in',
|
||||||
leaveAnimation: 'modal-slide-out'
|
leaveAnimation: 'modal-slide-out'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Static Methods */
|
open(ComponentType: Type, opts) {
|
||||||
static open(ComponentType: Type, opts) {
|
return this.create(OVERLAY_TYPE, ComponentType, opts);
|
||||||
return this.create(overlayType, ComponentType, opts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get() {
|
get() {
|
||||||
return Modal.getByType(overlayType);
|
return this.getByType(OVERLAY_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const overlayType = 'modal';
|
const OVERLAY_TYPE = 'modal';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
import {View} from 'angular2/src/core/annotations_impl/view';
|
||||||
import {Parent, Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
import {Parent, Ancestor} from 'angular2/src/core/annotations_impl/visibility';
|
||||||
|
|
||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView, IonicConfig} from 'ionic/ionic';
|
||||||
|
|
||||||
import {IonicComponent} from 'ionic/ionic';
|
import {IonicComponent} from 'ionic/ionic';
|
||||||
import {Modal, NavController, NavParams, Animation, ActionMenu} from 'ionic/ionic';
|
import {Modal, NavController, NavParams, Animation, ActionMenu} from 'ionic/ionic';
|
||||||
@ -35,13 +35,21 @@ class FadeOut extends Animation {
|
|||||||
Animation.register('my-fade-out', FadeOut);
|
Animation.register('my-fade-out', FadeOut);
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({
|
||||||
|
selector: 'ion-app',
|
||||||
|
appInjector: [Modal]
|
||||||
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class IonicApp {
|
class MyApp {
|
||||||
|
|
||||||
|
constructor(Modal: Modal) {
|
||||||
|
this.Modal = Modal;
|
||||||
|
}
|
||||||
|
|
||||||
openModal() {
|
openModal() {
|
||||||
Modal.open(ContactModal, {
|
this.Modal.open(ContactModal, {
|
||||||
enterAnimation: 'my-fade-in',
|
enterAnimation: 'my-fade-in',
|
||||||
leaveAnimation: 'my-fade-out',
|
leaveAnimation: 'my-fade-out',
|
||||||
handle: 'my-awesome-modal'
|
handle: 'my-awesome-modal'
|
||||||
@ -51,17 +59,20 @@ class IonicApp {
|
|||||||
|
|
||||||
@IonicComponent(Modal)
|
@IonicComponent(Modal)
|
||||||
@IonicView({
|
@IonicView({
|
||||||
template: '<ion-nav [initial]="initial"></ion-nav>'
|
template: '<ion-nav [root]="rootView"></ion-nav>'
|
||||||
})
|
})
|
||||||
export class ContactModal extends Modal {
|
export class ContactModal extends Modal {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.initial = ModalFirstPage;
|
this.rootView = ModalFirstPage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Component({selector: 'ion-view'})
|
@Component({
|
||||||
|
selector: 'ion-view',
|
||||||
|
appInjector: [Modal]
|
||||||
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
<ion-navbar *navbar><ion-title>First Page Header: {{ val }}</ion-title><ion-nav-items primary><button primary (click)="closeModal()">Close</button></ion-nav-items></ion-navbar>
|
<ion-navbar *navbar><ion-title>First Page Header: {{ val }}</ion-title><ion-nav-items primary><button primary (click)="closeModal()">Close</button></ion-nav-items></ion-navbar>
|
||||||
@ -83,10 +94,12 @@ export class ContactModal extends Modal {
|
|||||||
})
|
})
|
||||||
export class ModalFirstPage {
|
export class ModalFirstPage {
|
||||||
constructor(
|
constructor(
|
||||||
nav: NavController
|
nav: NavController,
|
||||||
|
Modal: Modal
|
||||||
) {
|
) {
|
||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
this.val = Math.round(Math.random() * 8999) + 1000;
|
this.val = Math.round(Math.random() * 8999) + 1000;
|
||||||
|
this.Modal = Modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
push() {
|
push() {
|
||||||
@ -94,7 +107,7 @@ export class ModalFirstPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
let modal = Modal.get();
|
let modal = this.Modal.get();
|
||||||
modal.close();
|
modal.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,5 +180,11 @@ export class ModalSecondPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function main(ionicBootstrap) {
|
export function main(ionicBootstrap) {
|
||||||
ionicBootstrap(IonicApp);
|
// crazy config
|
||||||
|
let myConfig = new IonicConfig();
|
||||||
|
|
||||||
|
ionicBootstrap(MyApp, myConfig).then(app => {
|
||||||
|
// crazy run
|
||||||
|
console.log('ionicBootstrap', app);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component, Directive} from 'angular2/src/core/annotations_impl/annotatio
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -13,7 +13,7 @@ import {ViewController} from '../view/view-controller';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-nav',
|
selector: 'ion-nav',
|
||||||
properties: [
|
properties: [
|
||||||
'initial'
|
'root'
|
||||||
],
|
],
|
||||||
lifecycle: [onInit]
|
lifecycle: [onInit]
|
||||||
})
|
})
|
||||||
@ -34,7 +34,7 @@ export class Nav extends ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
onInit() {
|
||||||
this.push(this.initial);
|
this.push(this.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import {Component, Directive, onInit} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
|
|
||||||
import {IonicView, IonicConfig} from 'ionic/ionic';
|
import {IonicView, IonicConfig, IonicApp} from 'ionic/ionic';
|
||||||
import {NavParams, Routable, Router, NavController} from 'ionic/ionic';
|
import {NavParams, Routable, Router, NavController} from 'ionic/ionic';
|
||||||
|
|
||||||
import {SecondPage} from './pages/second-page'
|
import {SecondPage} from './second-page'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view',
|
selector: 'ion-view'
|
||||||
lifecycle: [onInit]
|
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
template: '' +
|
template: '' +
|
||||||
@ -30,13 +29,15 @@ import {SecondPage} from './pages/second-page'
|
|||||||
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
|
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
|
||||||
'</ion-content>'
|
'</ion-content>'
|
||||||
})
|
})
|
||||||
class FirstPage {
|
export class FirstPage {
|
||||||
constructor(
|
constructor(
|
||||||
nav: NavController,
|
nav: NavController,
|
||||||
myConfig: IonicConfig
|
app: IonicApp,
|
||||||
|
config: IonicConfig
|
||||||
) {
|
) {
|
||||||
|
|
||||||
console.log('myConfig', myConfig);
|
console.log('app', app)
|
||||||
|
console.log('config', config)
|
||||||
|
|
||||||
// TODO: Shouldn't have to do this
|
// TODO: Shouldn't have to do this
|
||||||
Router.setNavController(nav);
|
Router.setNavController(nav);
|
||||||
@ -44,16 +45,12 @@ class FirstPage {
|
|||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
this.val = Math.round(Math.random() * 8999) + 1000;
|
this.val = Math.round(Math.random() * 8999) + 1000;
|
||||||
|
|
||||||
|
|
||||||
this.pushPage = SecondPage;
|
this.pushPage = SecondPage;
|
||||||
this.pushData = {
|
this.pushData = {
|
||||||
id: 420
|
id: 420
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
viewLoaded() {
|
viewLoaded() {
|
||||||
this.router = FirstPage.router.invoke(this);
|
this.router = FirstPage.router.invoke(this);
|
||||||
console.log('viewLoaded first page');
|
console.log('viewLoaded first page');
|
||||||
@ -99,10 +96,3 @@ class FirstPage {
|
|||||||
new Routable(FirstPage, {
|
new Routable(FirstPage, {
|
||||||
url: '/first-page'
|
url: '/first-page'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
export function main(ionicBootstrap) {
|
|
||||||
let myConfig = new IonicConfig();
|
|
||||||
|
|
||||||
ionicBootstrap(FirstPage, myConfig);
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
import {IonicRoot} from '../app/app';
|
import {IonicApp} from '../app/app';
|
||||||
import {Animation} from '../../animations/animation';
|
import {Animation} from '../../animations/animation';
|
||||||
import {ClickBlock} from '../../util/click-block';
|
import {ClickBlock} from '../../util/click-block';
|
||||||
import * as util from 'ionic/util';
|
import * as util from 'ionic/util';
|
||||||
@ -6,18 +6,50 @@ import * as util from 'ionic/util';
|
|||||||
|
|
||||||
export class Overlay {
|
export class Overlay {
|
||||||
|
|
||||||
constructor() {
|
constructor(app: IonicApp) {
|
||||||
this.zIndex = Root_ZIndex;
|
this.setApp(app);
|
||||||
for (let i = 0; i < overlayStack.length; i++) {
|
|
||||||
this.zIndex = overlayStack[i].zIndex + 1;
|
|
||||||
}
|
|
||||||
overlayStack.push(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Instance Methods */
|
setApp(app) {
|
||||||
open(opts) {
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
create(overlayType, ComponentType: Type, opts) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let app = this.app;
|
||||||
|
|
||||||
|
app.appendComponent(ComponentType).then(ref => {
|
||||||
|
let overlay = ref.instance;
|
||||||
|
overlay.setApp(app);
|
||||||
|
overlay._type = overlayType;
|
||||||
|
overlay._handle = opts && opts.handle;
|
||||||
|
overlay._domElement = ref.elementRef.domElement;
|
||||||
|
overlay.extendOptions(opts);
|
||||||
|
|
||||||
|
overlay.zIndex = ROOT_Z_INDEX;
|
||||||
|
for (let i = 0; i < app.overlays.length; i++) {
|
||||||
|
if (app.overlays[i].zIndex >= overlay.zIndex) {
|
||||||
|
overlay.zIndex = app.overlays[i].zIndex + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
app.overlays.push(overlay);
|
||||||
|
|
||||||
|
overlay._open(opts);
|
||||||
|
|
||||||
|
resolve(overlay);
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('Overlay create:', err);
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_open(opts) {
|
||||||
let animationName = (opts && opts.animation) || this.options.enterAnimation;
|
let animationName = (opts && opts.animation) || this.options.enterAnimation;
|
||||||
let enterAnimation = Animation.create(this._domElement, animationName);
|
let enterAnimation = Animation.create(this._domElement, animationName);
|
||||||
|
enterAnimation.before.addClass('ion-app');
|
||||||
enterAnimation.before.addClass('show-overlay');
|
enterAnimation.before.addClass('show-overlay');
|
||||||
ClickBlock(true, enterAnimation.duration() + 200);
|
ClickBlock(true, enterAnimation.duration() + 200);
|
||||||
|
|
||||||
@ -38,7 +70,7 @@ export class Overlay {
|
|||||||
ClickBlock(true, leavingAnimation.duration() + 200);
|
ClickBlock(true, leavingAnimation.duration() + 200);
|
||||||
|
|
||||||
leavingAnimation.play().then(() => {
|
leavingAnimation.play().then(() => {
|
||||||
this._clean();
|
this._dispose();
|
||||||
ClickBlock(false);
|
ClickBlock(false);
|
||||||
leavingAnimation.dispose();
|
leavingAnimation.dispose();
|
||||||
resolve();
|
resolve();
|
||||||
@ -46,56 +78,40 @@ export class Overlay {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getByType(overlayType) {
|
||||||
|
if (this.app) {
|
||||||
|
for (let i = this.app.overlays.length - 1; i >= 0; i--) {
|
||||||
|
if (overlayType === this.app.overlays[i]._type) {
|
||||||
|
return this.app.overlays[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
getByHandle(handle) {
|
||||||
|
if (this.app) {
|
||||||
|
for (let i = this.app.overlays.length - 1; i >= 0; i--) {
|
||||||
|
if (handle === this.app.overlays[i]._handle) {
|
||||||
|
return this.app.overlays[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
extendOptions(opts) {
|
extendOptions(opts) {
|
||||||
if (!this.options) this.options = {};
|
if (!this.options) this.options = {};
|
||||||
util.extend(this.options, opts);
|
util.extend(this.options, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
_clean() {
|
_dispose() {
|
||||||
this._dispose && this._dispose();
|
this.dispose && this.dispose();
|
||||||
util.array.remove(overlayStack, this);
|
if (this.app) {
|
||||||
|
util.array.remove(this.app.overlays, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Static Methods */
|
|
||||||
static create(overlayType, ComponentType: Type, opts) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
IonicRoot.append(ComponentType).then(ref => {
|
|
||||||
let overlay = ref.instance;
|
|
||||||
overlay._type = overlayType;
|
|
||||||
overlay._handle = opts && opts.handle;
|
|
||||||
overlay._dispose = ref.dispose;
|
|
||||||
overlay._domElement = ref.elementRef.domElement;
|
|
||||||
overlay.extendOptions(opts);
|
|
||||||
overlay.open(opts);
|
|
||||||
resolve(overlay);
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
console.error('Overlay create:', err);
|
|
||||||
reject(err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
static getByType(overlayType) {
|
|
||||||
for (let i = overlayStack.length - 1; i >= 0; i--) {
|
|
||||||
if (overlayType === overlayStack[i]._type) {
|
|
||||||
return overlayStack[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static getByHandle(handle) {
|
|
||||||
for (let i = overlayStack.length - 1; i >= 0; i--) {
|
|
||||||
if (handle === overlayStack[i]._handle) {
|
|
||||||
return overlayStack[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let overlayStack = [];
|
const ROOT_Z_INDEX = 1000;
|
||||||
const Root_ZIndex = 1000;
|
|
||||||
|
@ -1,18 +1,14 @@
|
|||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {View} from 'angular2/src/core/annotations_impl/view';
|
|
||||||
|
|
||||||
//import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
|
|
||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
class IonicApp {
|
class IonicApp {
|
||||||
constructor() {
|
constructor() {
|
||||||
console.log('IonicApp Start')
|
|
||||||
|
|
||||||
// var fb = new FormBuilder();
|
// var fb = new FormBuilder();
|
||||||
// this.form = fb.group({
|
// this.form = fb.group({
|
||||||
// preferredApple: ['mac', Validators.required],
|
// preferredApple: ['mac', Validators.required],
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
|
import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
||||||
import {FormBuilder, Validators, ControlGroup} from 'angular2/forms';
|
import {FormBuilder, Validators, ControlGroup} from 'angular2/forms';
|
||||||
|
|
||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -4,7 +4,7 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view'
|
selector: 'ion-app'
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
|
@ -4,7 +4,7 @@ import {IonicView} from 'ionic/ionic';
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view'
|
selector: 'ion-app'
|
||||||
})
|
})
|
||||||
@IonicView({
|
@IonicView({
|
||||||
template: `
|
template: `
|
||||||
|
@ -4,7 +4,7 @@ import {FormBuilder, Validators, ControlGroup} from 'angular2/forms';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -15,7 +15,7 @@ import {IonicView, NavController} from 'ionic/ionic';
|
|||||||
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
|
'<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>' +
|
||||||
'</ion-content>'
|
'</ion-content>'
|
||||||
})
|
})
|
||||||
class IonicApp {
|
class SignIn {
|
||||||
constructor(nav: NavController) {
|
constructor(nav: NavController) {
|
||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
}
|
}
|
||||||
@ -175,6 +175,19 @@ class Tab2Page3 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ion-app'
|
||||||
|
})
|
||||||
|
@IonicView({
|
||||||
|
template: '<ion-nav [root]="rootView"></ion-nav>'
|
||||||
|
})
|
||||||
|
class IonicApp {
|
||||||
|
constructor() {
|
||||||
|
this.rootView = SignIn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function main(ionicBootstrap) {
|
export function main(ionicBootstrap) {
|
||||||
ionicBootstrap(IonicApp);
|
ionicBootstrap(IonicApp);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@ import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
|||||||
import {IonicView} from 'ionic/ionic';
|
import {IonicView} from 'ionic/ionic';
|
||||||
|
|
||||||
|
|
||||||
@Component({ selector: 'ion-view' })
|
@Component({ selector: 'ion-app' })
|
||||||
@IonicView({
|
@IonicView({
|
||||||
templateUrl: 'main.html'
|
templateUrl: 'main.html'
|
||||||
})
|
})
|
||||||
|
@ -92,7 +92,7 @@ function appendModeConfig(ComponentType) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let id = config.classId || config.selector.replace('ion-', '');
|
let id = config.classId || (config.selector && config.selector.replace('ion-', ''));
|
||||||
config.host['class'] = (id + ' ' + id + '-' + platformMode);
|
config.host['class'] = (id + ' ' + id + '-' + platformMode);
|
||||||
|
|
||||||
return config;
|
return config;
|
@ -6,7 +6,6 @@ import {
|
|||||||
Aside, Content, Refresher,
|
Aside, Content, Refresher,
|
||||||
Slides, Slide, SlidePager,
|
Slides, Slide, SlidePager,
|
||||||
Tabs, Tab,
|
Tabs, Tab,
|
||||||
ActionMenu,
|
|
||||||
List, Item,
|
List, Item,
|
||||||
Icon,
|
Icon,
|
||||||
Checkbox, Switch, Label, Input, Segment, SegmentButton,
|
Checkbox, Switch, Label, Input, Segment, SegmentButton,
|
||||||
@ -28,9 +27,6 @@ export class IonicView extends View {
|
|||||||
Slides, Slide, SlidePager,
|
Slides, Slide, SlidePager,
|
||||||
Tabs, Tab,
|
Tabs, Tab,
|
||||||
|
|
||||||
// Overlays
|
|
||||||
ActionMenu,
|
|
||||||
|
|
||||||
// Media
|
// Media
|
||||||
Icon,
|
Icon,
|
||||||
|
|
||||||
@ -46,3 +42,4 @@ export class IonicView extends View {
|
|||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ele = document.querySelectorAll('ionic');
|
var ele = document.querySelectorAll('[module]');
|
||||||
for (var i = 0; i < ele.length; i++) {
|
for (var i = 0; i < ele.length; i++) {
|
||||||
importApp(ele[i].getAttribute('module'));
|
importApp(ele[i].getAttribute('module'));
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
export * from 'ionic/config/component'
|
|
||||||
export * from 'ionic/config/config'
|
export * from 'ionic/config/config'
|
||||||
export * from 'ionic/config/view'
|
export * from 'ionic/config/ionic-directive'
|
||||||
|
export * from 'ionic/config/ionic-view'
|
||||||
|
|
||||||
export * from 'ionic/components'
|
export * from 'ionic/components'
|
||||||
export * from 'ionic/platform/platform'
|
export * from 'ionic/platform/platform'
|
||||||
export * from 'ionic/routing/router'
|
export * from 'ionic/routing/router'
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
|
|
||||||
<!-- https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization -->
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
||||||
|
|
||||||
<link href="/css/ionic.css" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
/* hack to create tall scrollable areas for testing using <f></f> */
|
|
||||||
f {
|
|
||||||
display: block;
|
|
||||||
margin: 15px auto;
|
|
||||||
max-width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
background: blue;
|
|
||||||
}
|
|
||||||
f:last-of-type {
|
|
||||||
background: red;
|
|
||||||
}
|
|
||||||
ion-tab:nth-of-type(2) f,
|
|
||||||
.green f {
|
|
||||||
background: green;
|
|
||||||
max-width: 250px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
ion-tab:nth-of-type(3) f,
|
|
||||||
.yellow f {
|
|
||||||
background: yellow;
|
|
||||||
width: 100px;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<ion-app>
|
|
||||||
Loading...
|
|
||||||
</ion-app>
|
|
||||||
|
|
||||||
<!-- scripts auto-added by angular build process -->
|
|
||||||
$SCRIPTS$
|
|
||||||
|
|
||||||
<!-- web animations polyfill for non-chrome browsers -->
|
|
||||||
<script src="/vendor/web-animations-js/web-animations.min.js"></script>
|
|
||||||
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
||||||
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
|
||||||
<link href="/css/ionic.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<ion-app>
|
|
||||||
Loading...
|
|
||||||
</ion-app>
|
|
||||||
|
|
||||||
<script src="http://localhost:8001/angular2.bundle.js"></script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
System.paths = {
|
|
||||||
'*': '/*.js',
|
|
||||||
'rx': 'rx.js'
|
|
||||||
};
|
|
||||||
register(System);
|
|
||||||
cjs(System);
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
System.import('src/components/segment/test/basic/index').then(function(m) { m.main(); }, console.error.bind(console))
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -35,9 +35,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<ionic module="{{MODULE}}">
|
<ion-app module="{{MODULE}}">
|
||||||
<ion-loading-icon></ion-loading-icon>
|
<ion-loading-icon></ion-loading-icon>
|
||||||
</ionic>
|
</ion-app>
|
||||||
|
|
||||||
<!-- angular2 dependencies -->
|
<!-- angular2 dependencies -->
|
||||||
<script src="/scripts/resources/traceur-runtime.js" type="text/javascript"></script>
|
<script src="/scripts/resources/traceur-runtime.js" type="text/javascript"></script>
|
||||||
|
Reference in New Issue
Block a user