mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Activator: activated
This commit is contained in:
@@ -6,6 +6,7 @@ import {Platform} from '../../platform/platform';
|
||||
import * as util from '../../util/util';
|
||||
|
||||
// injectables
|
||||
import {Activator} from '../../util/activator';
|
||||
import {ActionMenu} from '../action-menu/action-menu';
|
||||
import {Modal} from '../modal/modal';
|
||||
import {Popup} from '../popup/popup';
|
||||
@@ -272,6 +273,7 @@ export function ionicBootstrap(rootComponentType, config) {
|
||||
Platform.prepareReady(config);
|
||||
|
||||
// TODO: probs need a better way to inject global injectables
|
||||
let activator = new Activator(app, config, window, document);
|
||||
let actionMenu = new ActionMenu(app, config);
|
||||
let modal = new Modal(app, config);
|
||||
let popup = new Popup(app, config);
|
||||
@@ -280,6 +282,7 @@ export function ionicBootstrap(rootComponentType, config) {
|
||||
let appBindings = Injector.resolve([
|
||||
bind(IonicApp).toValue(app),
|
||||
bind(IonicConfig).toValue(config),
|
||||
bind(Activator).toValue(activator),
|
||||
bind(ActionMenu).toValue(actionMenu),
|
||||
bind(Modal).toValue(modal),
|
||||
bind(Popup).toValue(popup),
|
||||
|
||||
@@ -4,7 +4,13 @@ import {App} from 'ionic/ionic';
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {}
|
||||
class E2EApp {
|
||||
|
||||
tapTest(eleType) {
|
||||
console.debug('test click', eleType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onEvent(ev) {
|
||||
@@ -74,6 +80,8 @@ console.debug = function() {
|
||||
|
||||
if(arguments[0] === 'click') msg = '<span style="color:purple">' + msg + '</span>';
|
||||
|
||||
if(arguments[0] === 'test click') msg = '<span style="color:orange">' + msg + '</span>';
|
||||
|
||||
msgs.unshift( msg );
|
||||
|
||||
if(msgs.length > 25) {
|
||||
|
||||
@@ -1,6 +1,41 @@
|
||||
|
||||
<button>
|
||||
<div><div><p>TAP ME</p></div></div>
|
||||
</button>
|
||||
<ion-row>
|
||||
|
||||
<ion-col>
|
||||
<button (^click)="tapTest('button')" block>
|
||||
<div><div><p>Button</p></div></div>
|
||||
</button>
|
||||
</ion-col>
|
||||
|
||||
<ion-col>
|
||||
<a button (^click)="tapTest('link')" block>
|
||||
Link
|
||||
</a>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
|
||||
<ion-col>
|
||||
<div button (^click)="tapTest('div')" block>
|
||||
Div w/ (click)
|
||||
</div>
|
||||
</ion-col>
|
||||
|
||||
<ion-col>
|
||||
<div button block>
|
||||
Div w/out (click)
|
||||
</div>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
|
||||
|
||||
<div id="logs"></div>
|
||||
|
||||
<style>
|
||||
.activated {
|
||||
background-color: yellow !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user