mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00

* chore(build): WIP getting ionic working with app-scripts the tsconfig file change is just for testing, this will need to be undone * chore(demos): update tsconfig and gitignore for demos update tsconfig and gitinogre for demos * chore(build): WIP check in progress with building with app-scripts this only works with demos/action-sheet currently * refactor(demos): add custom copy config add custom copy config * chore(tsconfig): revert root tsconfig * chore(demos): change import paths * chore(demos): move sass config, add new tsconfig, update template * chore(scripts): update demos tasks to use app scripts with folder name tweak the createTempTsConfig function to include a path to read from, move getFolderInfo into util to share at this point you should be able to run `gulp demos.prod` with a folder e.g. `--f=alert` and open the index of that test to see it. Doesn’t work yet with all of the tests at once. Need to have ran `gulp release.prepareReleasePackage` first. * chore(build): WIP working on getting all of the demos building * chore(demos): update demos task for app-scripts build * chore(demos): fix tslint errors thrown by app-scripts * chore(demos): get the demos working with fonts and variable file * chore(demos): add watch task to the new prod task * chore(demos): remove old demos.prod file and rename new one to it * chore(npm): remove build npm script * chore(demos): only log component name in url if one was passed
149 lines
3.1 KiB
TypeScript
149 lines
3.1 KiB
TypeScript
import { Component, NgModule } from '@angular/core';
|
|
import { IonicApp, IonicModule, LoadingController, NavController } from '../../ionic-angular';
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'page.html'
|
|
})
|
|
export class Page1 {
|
|
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
|
|
|
|
presentLoadingIos() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'ios',
|
|
content: 'This is the "ios" spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingDots() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'dots',
|
|
content: 'This is the "dots" spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingBubbles() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'bubbles',
|
|
content: 'This is the "bubbles" spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingCircles() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'circles',
|
|
content: 'This is the "circles" spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingCrescent() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'crescent',
|
|
content: 'This is the "crescent" spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingDefault() {
|
|
let loading = this.loadingCtrl.create({
|
|
content: 'This is the mode specific spinner. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingCustom() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'hide',
|
|
content: `
|
|
<div class="loading-custom-spinner-container">
|
|
<div class="loading-custom-spinner-box"></div>
|
|
</div>
|
|
<div>This is a custom spinner. It will dismiss after 3 seconds.</div>`,
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
presentLoadingText() {
|
|
let loading = this.loadingCtrl.create({
|
|
spinner: 'hide',
|
|
content: 'This has no spinner, only text. It will dismiss after 3 seconds.',
|
|
duration: 3000
|
|
});
|
|
|
|
loading.present();
|
|
}
|
|
|
|
goToPage2() {
|
|
let loading = this.loadingCtrl.create({
|
|
content: 'This will navigate to the next page and then dismiss after 3 seconds.'
|
|
});
|
|
|
|
loading.present();
|
|
|
|
setTimeout(() => {
|
|
this.navCtrl.push(Page2);
|
|
}, 1000);
|
|
|
|
setTimeout(() => {
|
|
loading.dismiss();
|
|
}, 4000);
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
template: `
|
|
<ion-header>
|
|
<ion-navbar>
|
|
<ion-title>Page 2</ion-title>
|
|
</ion-navbar>
|
|
</ion-header>
|
|
<ion-content padding>This is another page!</ion-content>
|
|
`
|
|
})
|
|
export class Page2 {}
|
|
|
|
|
|
@Component({
|
|
template: '<ion-nav [root]="root"></ion-nav>'
|
|
})
|
|
export class ApiDemoApp {
|
|
root = Page1;
|
|
}
|
|
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
ApiDemoApp,
|
|
Page1,
|
|
Page2
|
|
],
|
|
imports: [
|
|
IonicModule.forRoot(ApiDemoApp)
|
|
],
|
|
bootstrap: [IonicApp],
|
|
entryComponents: [
|
|
Page1,
|
|
Page2
|
|
]
|
|
})
|
|
export class AppModule {}
|