mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
demos(ngmodule): update to ngmodule
This commit is contained in:

committed by
Adam Bradley

parent
25ff530dcf
commit
22034b8ac4
110
demos/segment/AppModule.ts
Normal file
110
demos/segment/AppModule.ts
Normal file
@ -0,0 +1,110 @@
|
||||
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 {});
|
Reference in New Issue
Block a user