mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
111 lines
1.7 KiB
TypeScript
111 lines
1.7 KiB
TypeScript
import { Component, NgModule } from '@angular/core';
|
|
|
|
import { IonicModule } from 'ionic-angular';
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'main.html'
|
|
})
|
|
export class ApiDemoPage {
|
|
appType = "Paid";
|
|
safari = "Shared Links";
|
|
weather = "sunny";
|
|
|
|
apps = {
|
|
"Paid": [
|
|
{
|
|
name: 'Monopoly',
|
|
price: '$0.99'
|
|
},
|
|
{
|
|
name: 'Angry Birds',
|
|
price: '$2.99'
|
|
}
|
|
],
|
|
"Free": [
|
|
{
|
|
name: 'Snapchat',
|
|
price: 'GET'
|
|
},
|
|
{
|
|
name: 'Instagram',
|
|
price: 'OPEN'
|
|
}
|
|
],
|
|
"Top": [
|
|
{
|
|
name: 'Spotify',
|
|
price: 'OPEN'
|
|
},
|
|
{
|
|
name: 'Pandora',
|
|
price: 'GET'
|
|
}
|
|
]
|
|
};
|
|
|
|
items = {
|
|
"Bookmarks": [
|
|
{
|
|
name: 'Favorites',
|
|
icon: 'ios-star-outline'
|
|
},
|
|
{
|
|
name: 'History',
|
|
icon: 'ios-clock-outline'
|
|
}
|
|
],
|
|
"Reading List": [
|
|
{
|
|
name: 'Terms of Service',
|
|
icon: 'create'
|
|
},
|
|
{
|
|
name: 'User Guide',
|
|
icon: 'book'
|
|
}
|
|
],
|
|
"Shared Links": [
|
|
{
|
|
name: 'Ionic Framework',
|
|
icon: 'ionic'
|
|
},
|
|
{
|
|
name: 'Learn Angular',
|
|
icon: 'logo-angular'
|
|
}
|
|
]
|
|
};
|
|
|
|
getItems(type) {
|
|
return this.apps[type];
|
|
}
|
|
|
|
getSafariItems(type) {
|
|
return this.items[type];
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
template: '<ion-nav [root]="root"></ion-nav>'
|
|
})
|
|
export class ApiDemoApp {
|
|
root = ApiDemoPage;
|
|
}
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
ApiDemoApp,
|
|
ApiDemoPage
|
|
],
|
|
imports: [
|
|
IonicModule.forRoot(ApiDemoApp)
|
|
],
|
|
bootstrap: [IonicApp],
|
|
entryComponents: [
|
|
ApiDemoPage
|
|
]
|
|
})
|
|
export class AppModule {});
|