mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
modal show
This commit is contained in:
@ -1,6 +1,10 @@
|
|||||||
<ion-tabbar view-title="My Tabs"></ion-tabbar>
|
<ion-tabbar view-title="My Tabs"></ion-tabbar>
|
||||||
<ion-tabbar view-title="Tabs 2"></ion-tabbar>
|
<ion-tabbar view-title="Tabs 2"></ion-tabbar>
|
||||||
<ion-tabbar view-title="Tabs 4"></ion-tabbar>
|
<ion-tabbar view-title="Tabs 4"></ion-tabbar>
|
||||||
|
|
||||||
|
<button (click)="showModal()">Show Modal</button>
|
||||||
|
<!--
|
||||||
<ion-modal>
|
<ion-modal>
|
||||||
<h2>I'm a modal!</h2>
|
<h2>I'm a modal!</h2>
|
||||||
</ion-modal>
|
</ion-modal>
|
||||||
|
-->
|
||||||
|
@ -15,6 +15,10 @@ class PlaygroundMain {
|
|||||||
constructor() {
|
constructor() {
|
||||||
console.log('Playground Start')
|
console.log('Playground Start')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showModal() {
|
||||||
|
Modal.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrap(PlaygroundMain)
|
bootstrap(PlaygroundMain)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Component, Template} from 'angular2/angular2';
|
import {NgElement, Component, Template} from 'angular2/angular2';
|
||||||
import {Ion} from '../ion';
|
import {Ion} from '../ion';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -12,9 +12,12 @@ import {Ion} from '../ion';
|
|||||||
</div>`
|
</div>`
|
||||||
})
|
})
|
||||||
class ModalWrapper extends Ion {
|
class ModalWrapper extends Ion {
|
||||||
constructor() {
|
constructor(@NgElement() el : NgElement) {
|
||||||
|
this.element = el
|
||||||
|
console.log('element', el)
|
||||||
}
|
}
|
||||||
show() {
|
show() {
|
||||||
|
this.element.domElement.classList.add('active')
|
||||||
}
|
}
|
||||||
hide() {
|
hide() {
|
||||||
}
|
}
|
||||||
@ -34,4 +37,8 @@ class ModalWrapper extends Ion {
|
|||||||
})
|
})
|
||||||
export class Modal extends Ion {
|
export class Modal extends Ion {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
|
static show() {
|
||||||
|
console.log('Showing modal')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user