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