forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.component.ts
More file actions
129 lines (104 loc) · 2.83 KB
/
app.component.ts
File metadata and controls
129 lines (104 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import { Component } from '@angular/core';
import { 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="custom-spinner-container">
<div class="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;
}