mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
BIN
demos/component-docs/img/avatar-frodo.jpg
Normal file
BIN
demos/component-docs/img/avatar-frodo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
demos/component-docs/img/avatar-gollum.jpg
Normal file
BIN
demos/component-docs/img/avatar-gollum.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
demos/component-docs/img/avatar-samwise.jpg
Normal file
BIN
demos/component-docs/img/avatar-samwise.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
47
demos/component-docs/modals/basic/modal-content.html
Normal file
47
demos/component-docs/modals/basic/modal-content.html
Normal file
@ -0,0 +1,47 @@
|
||||
<ion-toolbar class="android-attr">
|
||||
<ion-title>
|
||||
Description
|
||||
</ion-title>
|
||||
<ion-nav-items primary>
|
||||
<button (click)="close()" *ng-if=" currentPlatform === 'ios' ">
|
||||
Cancel
|
||||
</button>
|
||||
<button (click)="close()" *ng-if=" currentPlatform === 'android' ">
|
||||
<icon close></icon>
|
||||
</button>
|
||||
</ion-nav-items>
|
||||
</ion-toolbar>
|
||||
|
||||
|
||||
<ion-content class="has-header">
|
||||
|
||||
<ion-list>
|
||||
|
||||
<ion-item>
|
||||
<ion-avatar item-left>
|
||||
<img src="{{character.image}}">
|
||||
</ion-avatar>
|
||||
<h2>{{character.name}}</h2>
|
||||
<p>{{character.quote}}</p>
|
||||
</ion-item>
|
||||
|
||||
<div *ng-for="#item of character['items']">
|
||||
<ion-item>
|
||||
{{item.title}}
|
||||
<ion-note item-right>
|
||||
{{item.note}}
|
||||
</ion-note>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-list>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
|
||||
<ion-content padding>
|
||||
<button block danger (click)="closeModal()">
|
||||
<icon close></icon>
|
||||
Close Modal
|
||||
</button>
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {App, IonicApp, Animation, Modal, NavController, Page, Events} from 'ionic/ionic';
|
||||
import {forwardRef} from 'angular2/angular2';
|
||||
import {App, IonicApp, Animation, Modal, Platform, NavController, Page, Events} from 'ionic/ionic';
|
||||
import {forwardRef, NgFor} from 'angular2/angular2';
|
||||
import * as helpers from '../../helpers';
|
||||
|
||||
|
||||
@ -7,35 +7,75 @@ import * as helpers from '../../helpers';
|
||||
templateUrl: 'modals/basic/template.html',
|
||||
directives: [forwardRef(() => helpers.AndroidAttribute)]
|
||||
})
|
||||
class ModalsFirstPage {
|
||||
class ModalsInitialPage {
|
||||
|
||||
constructor(
|
||||
nav: NavController,
|
||||
modal: Modal,
|
||||
events: Events
|
||||
) {
|
||||
this.nav = nav;
|
||||
this.modal = modal;
|
||||
}
|
||||
|
||||
openModal() {
|
||||
this.modal.open(ModalsContentPage);
|
||||
openModal(characterNum) {
|
||||
this.modal.open(ModalsContentPage, characterNum);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Page({
|
||||
templateUrl: 'modals/basic/modals-content.html',
|
||||
directives: [forwardRef(() => helpers.AndroidAttribute)]
|
||||
templateUrl: 'modals/basic/modal-content.html',
|
||||
directives: [NgFor, forwardRef(() => helpers.AndroidAttribute)]
|
||||
|
||||
})
|
||||
class ModalsContentPage {
|
||||
|
||||
constructor(
|
||||
modal: Modal,
|
||||
events: Events
|
||||
platform: Platform,
|
||||
) {
|
||||
this.modal = modal;
|
||||
if (platform.is('android')) {
|
||||
this.currentPlatform = 'android';
|
||||
} else {
|
||||
this.currentPlatform = 'ios';
|
||||
}
|
||||
|
||||
var characters = [
|
||||
{
|
||||
name: 'Gollum',
|
||||
quote: 'Sneaky little hobbitses!',
|
||||
image: 'img/avatar-gollum.jpg',
|
||||
items: [
|
||||
{ title: 'Race', note: 'Hobbit' },
|
||||
{ title: 'Culture', note: 'River Folk' },
|
||||
{ title: 'Alter Ego', note: 'Smeagol' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Frodo',
|
||||
quote: 'Go back, Sam! I\'m going to Mordor alone!',
|
||||
image: 'img/avatar-frodo.jpg',
|
||||
items: [
|
||||
{ title: 'Race', note: 'Hobbit' },
|
||||
{ title: 'Culture', note: 'Shire Folk' },
|
||||
{ title: 'Weapon', note: 'Sting' }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Samwise Gamgee',
|
||||
quote: 'What we need is a few good taters.',
|
||||
image: 'img/avatar-samwise.jpg',
|
||||
items: [
|
||||
{ title: 'Race', note: 'Hobbit' },
|
||||
{ title: 'Culture', note: 'Shire Folk' },
|
||||
{ title: 'Nickname', note: 'Sam' }
|
||||
]
|
||||
}
|
||||
];
|
||||
this.character = characters[this.modal._defaults.charNum];
|
||||
|
||||
}
|
||||
|
||||
closeModal() {
|
||||
@ -51,7 +91,7 @@ class ModalsContentPage {
|
||||
})
|
||||
export class BasicPage {
|
||||
constructor(modal: Modal) {
|
||||
this.rootView = ModalsFirstPage;
|
||||
this.rootView = ModalsInitialPage;
|
||||
this.modal = modal;
|
||||
}
|
||||
onPageWillLeave() {
|
||||
@ -61,3 +101,5 @@ export class BasicPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,10 +1,23 @@
|
||||
|
||||
<ion-navbar *navbar hide-back-button class="android-attr">
|
||||
<ion-navbar *navbar class="android-attr">
|
||||
<ion-title>Modals</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
<ion-content padding class="has-header">
|
||||
<button block (click)="openModal()">
|
||||
Show Modal
|
||||
</button>
|
||||
<ion-content class="has-header">
|
||||
|
||||
<ion-list>
|
||||
<ion-header>
|
||||
Hobbits
|
||||
</ion-header>
|
||||
<a ion-item (click)="openModal({charNum: 0})">
|
||||
Gollum
|
||||
</a>
|
||||
<a ion-item (click)="openModal({charNum: 1})">
|
||||
Frodo Baggins
|
||||
</a>
|
||||
<a ion-item (click)="openModal({charNum: 2})">
|
||||
Sam
|
||||
</a>
|
||||
</ion-list>
|
||||
|
||||
</ion-content>
|
||||
|
Reference in New Issue
Block a user