mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Compare commits
303 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b92a5a8c2 | ||
|
|
59f9737d9b | ||
|
|
0967b63a51 | ||
|
|
db37072c40 | ||
|
|
9316f73b81 | ||
|
|
55dfd254e5 | ||
|
|
0a97cf2d5f | ||
|
|
94a33a74d2 | ||
|
|
b4c6cea760 | ||
|
|
0b440edc51 | ||
|
|
e10f9b1a06 | ||
|
|
8586cc11ed | ||
|
|
33be36d070 | ||
|
|
a0554573de | ||
|
|
fa7ea0c617 | ||
|
|
c72598a810 | ||
|
|
4ac8ffb6ed | ||
|
|
979ca63a6a | ||
|
|
57f3f9742b | ||
|
|
74f90e6d57 | ||
|
|
44f36c4509 | ||
|
|
eb468d2530 | ||
|
|
156b982510 | ||
|
|
84e84d3280 | ||
|
|
8eef99d82f | ||
|
|
404d977c81 | ||
|
|
682ce49592 | ||
|
|
0cd9a373e7 | ||
|
|
41e34fc4ce | ||
|
|
d9a7652912 | ||
|
|
515de26a8b | ||
|
|
c9851442c6 | ||
|
|
47e1cdce9d | ||
|
|
6360d41f6a | ||
|
|
c19615ed11 | ||
|
|
b5c7ab2e98 | ||
|
|
3d569eb88a | ||
|
|
9be5751eeb | ||
|
|
9a4d81b329 | ||
|
|
54acc74fdb | ||
|
|
3819740998 | ||
|
|
e8ba41aac2 | ||
|
|
43de89f096 | ||
|
|
9fd231a04c | ||
|
|
ccc3696b9a | ||
|
|
36b7d338f6 | ||
|
|
5974dcea9e | ||
|
|
9e4a5cb496 | ||
|
|
d403638d71 | ||
|
|
93cfa17638 | ||
|
|
7272b5a42a | ||
|
|
7cee7b0eaf | ||
|
|
f20dda9da7 | ||
|
|
ccb49f36d6 | ||
|
|
8ac2ff485a | ||
|
|
63fd63e72e | ||
|
|
a252a94136 | ||
|
|
19c36deea3 | ||
|
|
2827275da6 | ||
|
|
58b57c0ca7 | ||
|
|
a3ead3d7c8 | ||
|
|
c78e0d21ec | ||
|
|
af6b54cda6 | ||
|
|
d04650c130 | ||
|
|
4e4e06898a | ||
|
|
4fbcda7440 | ||
|
|
e07aad460d | ||
|
|
d3e6b36a28 | ||
|
|
4b9f673594 | ||
|
|
09b01baa4e | ||
|
|
a63f760786 | ||
|
|
e0b09615bd | ||
|
|
f88f588d2d | ||
|
|
99142f8ebe | ||
|
|
02f8f11e74 | ||
|
|
daab927fbd | ||
|
|
945cd8ff52 | ||
|
|
e1617c1433 | ||
|
|
a2a77f06d1 | ||
|
|
042f698555 | ||
|
|
5c612aa33e | ||
|
|
b56b0e8105 | ||
|
|
0ccd96e8b5 | ||
|
|
af16846568 | ||
|
|
d5ba56f144 | ||
|
|
67ddafca25 | ||
|
|
b10ec68087 | ||
|
|
52081a471a | ||
|
|
56364a0503 | ||
|
|
5c2aa2adaf | ||
|
|
fbed3c5b04 | ||
|
|
da8ce042b6 | ||
|
|
960e529b43 | ||
|
|
ae56039ba1 | ||
|
|
7e9bad5092 | ||
|
|
963cdcbe76 | ||
|
|
c79bd5ab81 | ||
|
|
7cc617e84e | ||
|
|
fa24e4052a | ||
|
|
546003037e | ||
|
|
25dd7b5fce | ||
|
|
74191c3e92 | ||
|
|
f7bcc4603c | ||
|
|
afd99baba0 | ||
|
|
06b388bb68 | ||
|
|
305848274d | ||
|
|
ddcd3cf1c5 | ||
|
|
5d668036e6 | ||
|
|
e191321193 | ||
|
|
c236a4bf4b | ||
|
|
19302a9fbf | ||
|
|
cff4c01bf0 | ||
|
|
769e7dc2aa | ||
|
|
eff420f4c7 | ||
|
|
53feb3f699 | ||
|
|
999efaca9a | ||
|
|
1222c56d23 | ||
|
|
05f1e24cb6 | ||
|
|
505ee58407 | ||
|
|
1efc4aea0f | ||
|
|
8f310eba4a | ||
|
|
46fe1ff53c | ||
|
|
aa287ce56f | ||
|
|
e53bad1bc3 | ||
|
|
6918275bd3 | ||
|
|
f9f9a1b441 | ||
|
|
d93ca82666 | ||
|
|
0ae638a6a0 | ||
|
|
e5f7812798 | ||
|
|
06246df3ce | ||
|
|
7a9f88fcda | ||
|
|
396f891f33 | ||
|
|
8c483f2529 | ||
|
|
4354fc212e | ||
|
|
ddb8ef23e0 | ||
|
|
0964c850d4 | ||
|
|
3118bbbd1b | ||
|
|
446e468b59 | ||
|
|
f84d38346e | ||
|
|
eaadea7569 | ||
|
|
c90fcb07e7 | ||
|
|
a7ea189fa3 | ||
|
|
67cbcdea3b | ||
|
|
ba3530657b | ||
|
|
f4c9ba6614 | ||
|
|
62bf2bee28 | ||
|
|
5b1126f7f2 | ||
|
|
84e25a17c2 | ||
|
|
30980b6798 | ||
|
|
e90d692b1f | ||
|
|
bee75f7d00 | ||
|
|
d538245178 | ||
|
|
b541832749 | ||
|
|
05859dba40 | ||
|
|
58beea30f5 | ||
|
|
c7ad3ce4bf | ||
|
|
1d68d1f91f | ||
|
|
0cd87f1078 | ||
|
|
7dfe061a7c | ||
|
|
8c75c214d7 | ||
|
|
5a4f8b9b5d | ||
|
|
f43444bf51 | ||
|
|
37c198414d | ||
|
|
5d178534c2 | ||
|
|
4852b4a3a4 | ||
|
|
d25943f27f | ||
|
|
bdbd521b13 | ||
|
|
759fe607c8 | ||
|
|
17359b7b8c | ||
|
|
c6343951ae | ||
|
|
e8f6e0134e | ||
|
|
a1a762c0e6 | ||
|
|
88a7f3e1c5 | ||
|
|
999f33a5b9 | ||
|
|
7c713e1a62 | ||
|
|
5b91317d39 | ||
|
|
6d8490e393 | ||
|
|
a4748fca69 | ||
|
|
2143f7198e | ||
|
|
f2894be061 | ||
|
|
1105bcda86 | ||
|
|
33f2f09c5e | ||
|
|
e56bad9977 | ||
|
|
8b3991cc78 | ||
|
|
a2e469d408 | ||
|
|
b53219a67c | ||
|
|
61a5317b25 | ||
|
|
1dd88830f9 | ||
|
|
930869476a | ||
|
|
c65bb4e64b | ||
|
|
28754926b5 | ||
|
|
656ea66632 | ||
|
|
7b5bb940c9 | ||
|
|
8674aaf419 | ||
|
|
ced9bd2bb8 | ||
|
|
3dfaa4c019 | ||
|
|
1fc1305dd5 | ||
|
|
90f9650d7a | ||
|
|
00d128f87f | ||
|
|
040981f585 | ||
|
|
b47848ceb2 | ||
|
|
3e70856c0b | ||
|
|
b7df0d8efb | ||
|
|
b12186bad1 | ||
|
|
3ebc3656c1 | ||
|
|
3b43a872a6 | ||
|
|
25f942e70f | ||
|
|
a43386a405 | ||
|
|
5a4c6093a7 | ||
|
|
beed9989ed | ||
|
|
6e1ae9710e | ||
|
|
dc53c8e9f6 | ||
|
|
552a88c73b | ||
|
|
9e4c3a6e3e | ||
|
|
3c4ed81845 | ||
|
|
73b7a00771 | ||
|
|
19ec0caebb | ||
|
|
719f6b194e | ||
|
|
66fcaa7a63 | ||
|
|
beabe32cf5 | ||
|
|
1dede2305f | ||
|
|
145fcd24f2 | ||
|
|
ca55907e46 | ||
|
|
15eaad6044 | ||
|
|
72c2b623e5 | ||
|
|
96657535f1 | ||
|
|
e40590d68c | ||
|
|
56e36c0754 | ||
|
|
49723c3b81 | ||
|
|
5364d00671 | ||
|
|
9f71fde276 | ||
|
|
a26b054a3f | ||
|
|
d5149313e6 | ||
|
|
2ef6d0ca75 | ||
|
|
7880d44c07 | ||
|
|
ed2e76b607 | ||
|
|
07ffddca9a | ||
|
|
51f4c19d77 | ||
|
|
1786f1b897 | ||
|
|
e001967fa8 | ||
|
|
68f3c6c0c8 | ||
|
|
d896682799 | ||
|
|
7ad8d47aea | ||
|
|
5b299a000f | ||
|
|
b0986f5d6d | ||
|
|
ece5047b6c | ||
|
|
a7ce20f990 | ||
|
|
caf2f55a77 | ||
|
|
4495663cea | ||
|
|
5c61cb23ac | ||
|
|
6d787553a3 | ||
|
|
702330478c | ||
|
|
42a0c7fa61 | ||
|
|
c144580a49 | ||
|
|
be79382386 | ||
|
|
0d32e5e791 | ||
|
|
0fdff89b67 | ||
|
|
7281f020f4 | ||
|
|
d666e8b8e5 | ||
|
|
fdd50ba47c | ||
|
|
738515879b | ||
|
|
8d9f374065 | ||
|
|
be0b6a8872 | ||
|
|
f577e54f38 | ||
|
|
6797ce536d | ||
|
|
7b97fb7487 | ||
|
|
116ae38ade | ||
|
|
176aa2303f | ||
|
|
1128c8b8a2 | ||
|
|
2c2b87b0b9 | ||
|
|
4e8176431a | ||
|
|
2408e94f5d | ||
|
|
3959272620 | ||
|
|
c65ec9899a | ||
|
|
ec40ea4256 | ||
|
|
42e6d7dfab | ||
|
|
b9a436278b | ||
|
|
2182cf341b | ||
|
|
32e4e3191b | ||
|
|
ac1a886158 | ||
|
|
0fa98b4728 | ||
|
|
10f39b07c8 | ||
|
|
8bbaee7064 | ||
|
|
98e8158b9c | ||
|
|
2f0ecf112f | ||
|
|
555519da62 | ||
|
|
6ceec7ad4d | ||
|
|
43b90973ef | ||
|
|
38717155a8 | ||
|
|
fd53e04a47 | ||
|
|
aa528fdb42 | ||
|
|
54e50f48e5 | ||
|
|
da14042094 | ||
|
|
fae38f910c | ||
|
|
52a6d41c86 | ||
|
|
6a0c92c509 | ||
|
|
f47d4927d3 | ||
|
|
41b063b7ae | ||
|
|
9cd42dd297 | ||
|
|
87e4fc6af8 | ||
|
|
caef5b2f7a | ||
|
|
7e33963daf | ||
|
|
51c398d614 |
284
CHANGELOG.md
284
CHANGELOG.md
@@ -1,3 +1,287 @@
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/driftyco/ionic/compare/v2.3.0...v3.0.0) (2017-04-05)
|
||||
|
||||
|
||||
### Steps to Upgrade
|
||||
|
||||
With this release comes a major update to Angular (Angular 4.0!), the latest version of TypeScript, and some optional structural changes to your application.
|
||||
|
||||
1. Update your package.json to match the following dependencies, remove the existing `node_modules` directory, and then run `npm install`:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"@angular/common": "4.0.0",
|
||||
"@angular/compiler": "4.0.0",
|
||||
"@angular/compiler-cli": "4.0.0",
|
||||
"@angular/core": "4.0.0",
|
||||
"@angular/forms": "4.0.0",
|
||||
"@angular/http": "4.0.0",
|
||||
"@angular/platform-browser": "4.0.0",
|
||||
"@angular/platform-browser-dynamic": "4.0.0",
|
||||
"@ionic-native/core": "3.4.2",
|
||||
"@ionic-native/splash-screen": "3.4.2",
|
||||
"@ionic-native/status-bar": "3.4.2",
|
||||
"@ionic/storage": "2.0.1",
|
||||
"ionic-angular": "3.0.0",
|
||||
"ionicons": "3.0.0",
|
||||
"rxjs": "5.1.1",
|
||||
"sw-toolbox": "3.4.0",
|
||||
"zone.js": "^0.8.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "1.3.0",
|
||||
"typescript": "~2.2.1"
|
||||
}
|
||||
```
|
||||
|
||||
2. Import the `BrowserModule` in your `app/app.module.ts` file:
|
||||
|
||||
```
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
```
|
||||
|
||||
and then add it to the imports in the same file:
|
||||
|
||||
```
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(MyApp)
|
||||
],
|
||||
```
|
||||
|
||||
3. If you are using Http, Import the `HttpModule` in your `app/app.module.ts` file:
|
||||
|
||||
```
|
||||
imports: [
|
||||
BrowserModule,
|
||||
HttpModule,
|
||||
IonicModule.forRoot(MyApp)
|
||||
],
|
||||
```
|
||||
|
||||
4. Upgrading to Ionic Native 3.x will result in a smaller bundle size. With Ionic Native 3, native functionality was moved from static methods to using Angular injectables.
|
||||
- Blog Post: http://blog.ionic.io/ionic-native-3-x/
|
||||
- Example Upgrade Commit: https://github.com/driftyco/ionic-conference-app/commit/62088
|
||||
|
||||
And that’s it! Your app should still function the same without any issues.
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **alert:** add missing cssClass property for buttons ([4fbcda7](https://github.com/driftyco/ionic/commit/4fbcda7))
|
||||
* **content:** remove scroll bouncing from desktop ([7cee7b0](https://github.com/driftyco/ionic/commit/7cee7b0))
|
||||
* **content:** enable scroll listener automatically ([d9a7652](https://github.com/driftyco/ionic/commit/d9a7652)), closes [#10938](https://github.com/driftyco/ionic/issues/10938)
|
||||
* **datetime:** emit ionCancel event on backdrop click ([#10532](https://github.com/driftyco/ionic/issues/10532)) ([4ac8ffb](https://github.com/driftyco/ionic/commit/4ac8ffb))
|
||||
* **datetime:** remove unnecessary calls and performance improvements ([99142f8](https://github.com/driftyco/ionic/commit/99142f8))
|
||||
* **infinite-scroll:** don't call `complete` if the state isn't loading ([58b57c0](https://github.com/driftyco/ionic/commit/58b57c0))
|
||||
* **item-sliding:** add forwardRef for item options ([0ccd96e](https://github.com/driftyco/ionic/commit/0ccd96e))
|
||||
* **navigation:** update the URL if there are no children navs ([8586cc1](https://github.com/driftyco/ionic/commit/8586cc1))
|
||||
* **slides:** negative number indicates position starting at end ([#10997](https://github.com/driftyco/ionic/issues/10997)) ([33be36d](https://github.com/driftyco/ionic/commit/33be36d))
|
||||
* **split-pane:** add RTL support ([57f3f97](https://github.com/driftyco/ionic/commit/57f3f97)), closes [#10903](https://github.com/driftyco/ionic/issues/10903)
|
||||
* **virtual-list:** fix the rendering of the first item ([ccb49f3](https://github.com/driftyco/ionic/commit/ccb49f3))
|
||||
* **virtual-list:** update compatibility with angular ([682ce49](https://github.com/driftyco/ionic/commit/682ce49))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **grid:** remove the old grid system ([19c36de](https://github.com/driftyco/ionic/commit/19c36de))
|
||||
* **typography:** remove the native element selectors ([2827275](https://github.com/driftyco/ionic/commit/2827275))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **module-loader:** add caching for ngModuleLoader on load ([17359b7](https://github.com/driftyco/ionic/commit/17359b7))
|
||||
* **module-loader:** add preloadModules config option, set to false ([bdbd521](https://github.com/driftyco/ionic/commit/bdbd521))
|
||||
* **module-loader:** preload modules based on priority ([5a4f8b9](https://github.com/driftyco/ionic/commit/5a4f8b9))
|
||||
* **module-loader:** run outside of angular and in requestIdleCallback ([c7ad3ce](https://github.com/driftyco/ionic/commit/c7ad3ce))
|
||||
* **navigation:** [@DeepLink](https://github.com/DeepLink) decorator ([3e70856](https://github.com/driftyco/ionic/commit/3e70856))
|
||||
* **navigation:** add optional priority to deep link config ([b47848c](https://github.com/driftyco/ionic/commit/b47848c))
|
||||
* **split-pane:** adds enabled input ([fa7ea0c](https://github.com/driftyco/ionic/commit/fa7ea0c)), closes [#10949](https://github.com/driftyco/ionic/issues/10949)
|
||||
* **split-pane:** sizing via scss variables ([979ca63](https://github.com/driftyco/ionic/commit/979ca63)), closes [#10893](https://github.com/driftyco/ionic/issues/10893)
|
||||
* **util:** system.js ng-module loader ([beabe32](https://github.com/driftyco/ionic/commit/beabe32))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
#### Grid
|
||||
|
||||
Removed the deprecated (old) grid. See the blog post for more information including steps to migrate:
|
||||
http://blog.ionic.io/build-awesome-desktop-apps-with-ionics-new-responsive-grid/
|
||||
|
||||
#### Typography
|
||||
|
||||
The following selectors to style the text color of the native text elements have been removed:
|
||||
|
||||
```
|
||||
h1[color], h2[color], h3[color], h4[color], h5[color], h6[color], a[color]:not([ion-button]):not([ion-item]):not([ion-fab]), p[color], span[color], b[color], i[color], strong[color], em[color], small[color], sub[color], sup[color]
|
||||
```
|
||||
|
||||
These have been throwing a deprecation warning since rc.3 but still working. They are officially gone and therefore these elements will not get the color unless the `ion-text` attribute is added. Please see the documentation for more information: http://ionicframework.com/docs/api/components/typography/Typography/
|
||||
|
||||
#### Slides
|
||||
|
||||
The following properties and functions have been printing console warnings and are officially removed:
|
||||
|
||||
Slides input `options` has been removed. Please use the input
|
||||
properties instead.
|
||||
|
||||
Slide event `ionWillChange` has been removed, please use
|
||||
`ionSlideWillChange` instead.
|
||||
|
||||
Slide event `ionDidChange` has been removed, please use
|
||||
`ionSlideDidChange` instead.
|
||||
|
||||
Slide event `ionDrag` has been removed, please use `ionSlideDrag`
|
||||
instead.
|
||||
|
||||
Slides `getSlider()` method has been removed, please use the instance
|
||||
of ion-slides.
|
||||
|
||||
|
||||
<a name="2.3.0"></a>
|
||||
# [2.3.0](https://github.com/driftyco/ionic/compare/v2.2.0...v2.3.0) (2017-03-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **alert:** pass id to alert inputs ([46fe1ff](https://github.com/driftyco/ionic/commit/46fe1ff)), closes [#10603](https://github.com/driftyco/ionic/issues/10603)
|
||||
* **datetime:** don't always disable day values when dayValues is set ([eff420f](https://github.com/driftyco/ionic/commit/eff420f))
|
||||
* **datetime:** move the call to picker.refresh() in generate ([58beea3](https://github.com/driftyco/ionic/commit/58beea3))
|
||||
* **datetime:** respect time limits in hours and minutes ([afd99ba](https://github.com/driftyco/ionic/commit/afd99ba)), closes [#6850](https://github.com/driftyco/ionic/issues/6850)
|
||||
* **datetime:** update selectedIndex according to ngModel value ([74191c3](https://github.com/driftyco/ionic/commit/74191c3))
|
||||
* **infinite-scroll:** add event.timeStamp polyfill for firefox ([#10752](https://github.com/driftyco/ionic/issues/10752)) ([53feb3f](https://github.com/driftyco/ionic/commit/53feb3f))
|
||||
* **picker:** initialize the selectionIndex ([ba35306](https://github.com/driftyco/ionic/commit/ba35306))
|
||||
* **range:** update the bar width correctly ([b541832](https://github.com/driftyco/ionic/commit/b541832)), closes [#10150](https://github.com/driftyco/ionic/issues/10150)
|
||||
* **range:** only activate knob B if range is dual ([d538245](https://github.com/driftyco/ionic/commit/d538245))
|
||||
* **scroll-view:** do not set initialized until it is enabled ([#10817](https://github.com/driftyco/ionic/issues/10817)) ([56364a0](https://github.com/driftyco/ionic/commit/56364a0))
|
||||
* **searchbar:** add IE support ([05859db](https://github.com/driftyco/ionic/commit/05859db))
|
||||
* **select:** make floating labels work for ion-select ([8c483f2](https://github.com/driftyco/ionic/commit/8c483f2)), closes [#10751](https://github.com/driftyco/ionic/issues/10751)
|
||||
* **slides:** fix rtl support ([e90d692](https://github.com/driftyco/ionic/commit/e90d692))
|
||||
* **slides:** simulate touch events for query params ([#10579](https://github.com/driftyco/ionic/issues/10579)) ([e191321](https://github.com/driftyco/ionic/commit/e191321)), closes [#10577](https://github.com/driftyco/ionic/issues/10577)
|
||||
* **toggle/checkbox:** trigger ui update when using virtalScroll with Angular Reactive Forms ([30980b6](https://github.com/driftyco/ionic/commit/30980b6))
|
||||
* **virtual-list:** make virtual-scroll work with infinite-scroll ([999efac](https://github.com/driftyco/ionic/commit/999efac)), closes [#9350](https://github.com/driftyco/ionic/issues/9350) [#9722](https://github.com/driftyco/ionic/issues/9722) [#9247](https://github.com/driftyco/ionic/issues/9247) [#10778](https://github.com/driftyco/ionic/issues/10778)
|
||||
* **virtualscroll:** populate the nodes at the correct height ([51c398d](https://github.com/driftyco/ionic/commit/51c398d))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **alert:** add attributes min & max to alert inputs ([d666e8b](https://github.com/driftyco/ionic/commit/d666e8b))
|
||||
* **alert:** add attributes min & max to alert inputs of type number ([b53219a](https://github.com/driftyco/ionic/commit/b53219a))
|
||||
* **infinite:** add scroll in opposite direction ([#8099](https://github.com/driftyco/ionic/issues/8099)) ([6918275](https://github.com/driftyco/ionic/commit/6918275))
|
||||
* **infinite-scroll:** add `waitFor` method to InfiniteScroll ([84e25a1](https://github.com/driftyco/ionic/commit/84e25a1))
|
||||
* **overlay:** add method chaining pattern to configure overlays ([bee75f7](https://github.com/driftyco/ionic/commit/bee75f7))
|
||||
* **range:** add ionFocus and ionBlur events ([#10761](https://github.com/driftyco/ionic/issues/10761)) ([8f310eb](https://github.com/driftyco/ionic/commit/8f310eb))
|
||||
* **split-pane:** support for side=right ([963cdcb](https://github.com/driftyco/ionic/commit/963cdcb))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **content:** scrollview magic activated on demand ([7e9bad5](https://github.com/driftyco/ionic/commit/7e9bad5))
|
||||
|
||||
|
||||
|
||||
<a name="2.2.0"></a>
|
||||
# [2.2.0](https://github.com/driftyco/ionic/compare/v2.1.0...v2.2.0) (2017-03-08)
|
||||
|
||||
### Updating to 2.2.0
|
||||
|
||||
1. Update your `package.json` to match the following dependencies, remove the existing `node_modules` directory, and then run `npm install`:
|
||||
|
||||
```
|
||||
"dependencies": {
|
||||
"@angular/common": "2.4.8",
|
||||
"@angular/compiler": "2.4.8",
|
||||
"@angular/compiler-cli": "2.4.8",
|
||||
"@angular/core": "2.4.8",
|
||||
"@angular/forms": "2.4.8",
|
||||
"@angular/http": "2.4.8",
|
||||
"@angular/platform-browser": "2.4.8",
|
||||
"@angular/platform-browser-dynamic": "2.4.8",
|
||||
"@angular/platform-server": "2.4.8",
|
||||
"@ionic/storage": "2.0.0",
|
||||
"ionic-angular": "2.2.0",
|
||||
"ionic-native": "2.4.1",
|
||||
"ionicons": "3.0.0",
|
||||
"rxjs": "5.0.1",
|
||||
"sw-toolbox": "3.4.0",
|
||||
"zone.js": "0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "1.1.4",
|
||||
"typescript": "2.0.9"
|
||||
}
|
||||
```
|
||||
Note: If you are using `ionic-storage`, you need to update it to `2.0.0` or you will run into an error similar to this: `Error: Can't resolve all parameters for Storage: (?, ?).`. For more information, see the [Storage Documentation](https://ionicframework.com/docs/v2/storage/).
|
||||
|
||||
### What's new
|
||||
|
||||
#### Split Pane
|
||||
As part of our initiative to improve desktop support we have introduced a new component called [Split Pane](http://ionicframework.com/docs/v2/api/components/split-pane/SplitPane/). Split Pane makes it possible to easily create multi-view layouts. It allows elements, such as a menu or another navigation pane, to be displayed on large viewports. Split Pane can be used to achieve a layout similar to the Gmail (Android) or Mail (Apple) applications.
|
||||
|
||||
#### Angular 2.4.8
|
||||
Ionic has been updated to depend on Angular 2.4.8, which is the latest version that we have tested and confirmed to be compatible with Ionic. This means that updating to the 2.2.0 release of Ionic will automatically work with all of the performance updates, bug fixes and features in Angular 2.4.8!
|
||||
|
||||
### Ionic Storage
|
||||
|
||||
We recently released the 2.0.0 version of `ionic-storage`. If you are using Ionic Storage in your application, you need to update to this version of `ionic-storage`. Attempting to use an older version of `ionic-storage` with Ionic 2.2.0 will cause errors. You can read about how to update to `ionic-storage` 2.0.0 [here](https://github.com/driftyco/ionic-storage/releases/tag/v2.0.0).
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **components:** clean up event listeners to stop memory leaks ([8d9f374](https://github.com/driftyco/ionic/commit/8d9f374)), closes [#10459](https://github.com/driftyco/ionic/issues/10459) [#10416](https://github.com/driftyco/ionic/issues/10416) [#10286](https://github.com/driftyco/ionic/issues/10286)
|
||||
* **infinite-scroll:** use icon color from Sass var and add var for text color ([7b97fb7](https://github.com/driftyco/ionic/commit/7b97fb7)), closes [#10574](https://github.com/driftyco/ionic/issues/10574)
|
||||
* **menu:** disable the menus when they should be ([dc53c8e](https://github.com/driftyco/ionic/commit/dc53c8e))
|
||||
* **menu:** don't hide menuToggle outside navbar ([e56bad9](https://github.com/driftyco/ionic/commit/e56bad9))
|
||||
* **radio:** calculate radio-inner width/height with border width ([#10495](https://github.com/driftyco/ionic/issues/10495)) ([176aa23](https://github.com/driftyco/ionic/commit/176aa23))
|
||||
* **refresher:** don't destroy events manager ([9308694](https://github.com/driftyco/ionic/commit/9308694)), ([1dd8883](https://github.com/driftyco/ionic/commit/1dd8883)), closes [#10652](https://github.com/driftyco/ionic/issues/10652)
|
||||
* **refresher:** use refresher icon color from Sass var ([116ae38](https://github.com/driftyco/ionic/commit/116ae38)), closes [#10479](https://github.com/driftyco/ionic/issues/10479)
|
||||
* **tabs:** emit ionChange after the tab is selected ([ac1a886](https://github.com/driftyco/ionic/commit/ac1a886)), closes [#10538](https://github.com/driftyco/ionic/issues/10538)
|
||||
* **tabs:** catch the rejected promise with popToRoot ([7385158](https://github.com/driftyco/ionic/commit/7385158))
|
||||
* **view-controller:** set navigation so dimiss() will work synchronously. ([61a5317](https://github.com/driftyco/ionic/commit/61a5317)), closes [#10654](https://github.com/driftyco/ionic/issues/10654)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **alert:** add ability to set the mode on alert ([f577e54](https://github.com/driftyco/ionic/commit/f577e54))
|
||||
* **split-pane:** split pane support for ion-nav and ion-menu ([#10343](https://github.com/driftyco/ionic/issues/10343)) ([9e4c3a6](https://github.com/driftyco/ionic/commit/9e4c3a6))
|
||||
* **typography:** add text-wrap attribute for all elements ([2c2b87b](https://github.com/driftyco/ionic/commit/2c2b87b)), closes [#7051](https://github.com/driftyco/ionic/issues/7051)
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/driftyco/ionic/compare/v2.0.1...v2.1.0) (2017-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **content:** check for scroll element before modifying it ([#10374](https://github.com/driftyco/ionic/issues/10374)) ([6a0c92c](https://github.com/driftyco/ionic/commit/6a0c92c))
|
||||
* **platform:** resize platform correctly ([54e50f](https://github.com/driftyco/ionic/commit/54e50f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **alert:** add sass variables for checkbox and radio button text color ([#10331](https://github.com/driftyco/ionic/issues/10331)) ([9cd42dd](https://github.com/driftyco/ionic/commit/9cd42dd))
|
||||
* **datetime:** add placeholder attribute ([52a6d41](https://github.com/driftyco/ionic/commit/52a6d41)), closes [#7966](https://github.com/driftyco/ionic/issues/7966)
|
||||
* **grid:** improve grid to a column layout with more flexibility ([#10485](https://github.com/driftyco/ionic/issues/10485)) ([6ceec7a](https://github.com/driftyco/ionic/commit/6ceec7a)), closes [#6050](https://github.com/driftyco/ionic/issues/6050) [#7508](https://github.com/driftyco/ionic/issues/7508)
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/driftyco/ionic/compare/v2.0.0...v2.0.1) (2017-02-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **chip:** align icon in the center ([ace727e](https://github.com/driftyco/ionic/commit/ace727e)), closes [#5386](https://github.com/driftyco/ionic/issues/5386)
|
||||
* **content:** check for this._scroll when reading dimensions ([#10216](https://github.com/driftyco/ionic/issues/10216)) ([96f550c](https://github.com/driftyco/ionic/commit/96f550c))
|
||||
* **datetime:** set input-has-value class without formControlName ([#8947](https://github.com/driftyco/ionic/issues/8947)) ([81c3394](https://github.com/driftyco/ionic/commit/81c3394))
|
||||
* **input:** add variables for alert and input placeholder color ([4ca9f2c](https://github.com/driftyco/ionic/commit/4ca9f2c)), closes [#10153](https://github.com/driftyco/ionic/issues/10153)
|
||||
* **input:** add max, min, step as inputs and pass to native ([803782a](https://github.com/driftyco/ionic/commit/803782a)), closes [#10189](https://github.com/driftyco/ionic/issues/10189)
|
||||
* **input:** don't allow focus when disabled is set ([#10214](https://github.com/driftyco/ionic/issues/10214)) ([eba0866](https://github.com/driftyco/ionic/commit/eba0866)), closes [#10155](https://github.com/driftyco/ionic/issues/10155)
|
||||
* **platform:** detect iPad Pro correctly ([#10292](https://github.com/driftyco/ionic/issues/10292)) ([f12fc61](https://github.com/driftyco/ionic/commit/f12fc61))
|
||||
* **toggle/checkbox:** allow value to be programmatically updated while disabled ([#10304](https://github.com/driftyco/ionic/issues/10304)) ([b8ee301](https://github.com/driftyco/ionic/commit/b8ee301)), closes [#9730](https://github.com/driftyco/ionic/issues/9730)
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/driftyco/ionic/compare/v2.0.0-rc.6...v2.0.0) (2017-01-25)
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
[](https://badge.fury.io/js/ionic-angular)
|
||||
[](http://issuestats.com/github/driftyco/ionic)
|
||||
[](http://issuestats.com/github/driftyco/ionic)
|
||||
[](https://circleci.com/gh/driftyco/ionic)
|
||||
|
||||
# Ionic
|
||||
|
||||
67
circle.yml
67
circle.yml
@@ -1,22 +1,45 @@
|
||||
general:
|
||||
branches:
|
||||
ignore:
|
||||
- ins_n_outs
|
||||
machine:
|
||||
node:
|
||||
version: 4.1.0
|
||||
post:
|
||||
- npm install -g npm@3.x.x
|
||||
dependencies:
|
||||
pre:
|
||||
- ./scripts/docs/prepare.sh
|
||||
cache_directories:
|
||||
- "~/ionic-site" # cache ionic-site
|
||||
test:
|
||||
override:
|
||||
- gulp lint.ts
|
||||
deployment:
|
||||
tasks:
|
||||
branch: "master"
|
||||
commands:
|
||||
- ./scripts/ci/deploy.sh
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/ionic/
|
||||
docker:
|
||||
- image: node:7
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: ionic-site
|
||||
- run:
|
||||
name: Prepare ionic-site repo
|
||||
command: ./scripts/docs/prepare.sh
|
||||
- save_cache:
|
||||
key: ionic-site
|
||||
paths:
|
||||
- ~/ionic-site/
|
||||
- restore_cache:
|
||||
key: node_modules_{{ checksum "package.json" }}
|
||||
- run:
|
||||
name: Install node modules
|
||||
command: npm i
|
||||
- save_cache:
|
||||
key: node_modules_{{ checksum "package.json" }}
|
||||
paths:
|
||||
- ~/ionic/node_modules/
|
||||
- run:
|
||||
name: Run tslint
|
||||
command: ./node_modules/.bin/gulp lint.ts
|
||||
- run:
|
||||
name: Build Demos
|
||||
command: |
|
||||
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
||||
./node_modules/.bin/gulp demos.prod --production=true --batch=$CIRCLE_NODE_INDEX --batches=$CIRCLE_NODE_TOTAL
|
||||
fi
|
||||
- add_ssh_keys
|
||||
- deploy:
|
||||
name: Update docs
|
||||
command: |
|
||||
if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
||||
./scripts/ci/deploy.sh
|
||||
else
|
||||
./scripts/ci/deploy.sh
|
||||
echo "We are on ${CIRCLE_BRANCH} branch, not going to update docs."
|
||||
fi
|
||||
|
||||
9
demos/src/action-sheet/app/app.component.ts
Normal file
9
demos/src/action-sheet/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/action-sheet/app/app.module.ts
Normal file
19
demos/src/action-sheet/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
17
demos/src/action-sheet/pages/page-one/page-one.module.ts
Normal file
17
demos/src/action-sheet/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { ActionSheetController, IonicApp, IonicModule, Platform } from '../../ionic-angular';
|
||||
import { Component } from '@angular/core';
|
||||
import { ActionSheetController, Platform } from '../../../../../src';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
constructor(public alertCtrl: ActionSheetController, public platform: Platform) { }
|
||||
|
||||
present() {
|
||||
@@ -55,26 +55,3 @@ export class ApiDemoPage {
|
||||
actionSheet.present();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/alert/app/app.component.ts
Normal file
9
demos/src/alert/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/alert/app/app.module.ts
Normal file
19
demos/src/alert/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
17
demos/src/alert/pages/page-one/page-one.module.ts
Normal file
17
demos/src/alert/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { AlertController, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AlertController } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
testRadioOpen = false;
|
||||
testRadioResult: any;
|
||||
testCheckboxOpen = false;
|
||||
@@ -59,13 +58,13 @@ export class ApiDemoPage {
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
handler: (data: any) => {
|
||||
handler: (data) => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Save',
|
||||
handler: (data: any) => {
|
||||
handler: (data) => {
|
||||
console.log('Saved clicked');
|
||||
}
|
||||
}
|
||||
@@ -208,25 +207,3 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@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 {}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/button/app/app.component.ts
Normal file
9
demos/src/button/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/button/app/app.module.ts
Normal file
19
demos/src/button/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/button/app/main.ts
Normal file
5
demos/src/button/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/button/pages/page-one/page-one.module.ts
Normal file
17
demos/src/button/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
6
demos/src/button/pages/page-one/page-one.ts
Normal file
6
demos/src/button/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
||||
@@ -1,49 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
|
||||
data = {
|
||||
jon: true,
|
||||
daenerys: true,
|
||||
arya: false,
|
||||
tyroin: false,
|
||||
sansa: true,
|
||||
khal: false,
|
||||
cersei: true,
|
||||
stannis: true,
|
||||
petyr: false,
|
||||
hodor: true,
|
||||
catelyn: true,
|
||||
bronn: false
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/checkbox/app/app.component.ts
Normal file
9
demos/src/checkbox/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/checkbox/app/app.module.ts
Normal file
19
demos/src/checkbox/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/checkbox/app/main.ts
Normal file
5
demos/src/checkbox/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/checkbox/pages/page-one/page-one.module.ts
Normal file
17
demos/src/checkbox/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
22
demos/src/checkbox/pages/page-one/page-one.ts
Normal file
22
demos/src/checkbox/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
|
||||
data = {
|
||||
jon: true,
|
||||
daenerys: true,
|
||||
arya: false,
|
||||
tyroin: false,
|
||||
sansa: true,
|
||||
khal: false,
|
||||
cersei: true,
|
||||
stannis: true,
|
||||
petyr: false,
|
||||
hodor: true,
|
||||
catelyn: true,
|
||||
bronn: false
|
||||
};
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@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 {}
|
||||
9
demos/src/chip/app/app.component.ts
Normal file
9
demos/src/chip/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/chip/app/app.module.ts
Normal file
19
demos/src/chip/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/chip/app/main.ts
Normal file
5
demos/src/chip/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/chip/pages/page-one/page-one.module.ts
Normal file
17
demos/src/chip/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
10
demos/src/chip/pages/page-one/page-one.ts
Normal file
10
demos/src/chip/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
delete(chip: Element) {
|
||||
chip.remove();
|
||||
}
|
||||
}
|
||||
39
demos/src/config/app/app.component.ts
Normal file
39
demos/src/config/app/app.component.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Config, Platform } from '../../../../src';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
config: any;
|
||||
root = PageOne;
|
||||
constructor(public _config: Config, public platform: Platform) {
|
||||
|
||||
if (window.localStorage.getItem('configDemo') !== null) {
|
||||
this.config = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
} else if (platform.is('ios')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
} else if (platform.is('windows')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'top'
|
||||
};
|
||||
} else {
|
||||
this.config = {
|
||||
'backButtonIcon': 'md-arrow-back',
|
||||
'iconMode': 'md',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
}
|
||||
|
||||
this._config.set('tabsPlacement', this.config.tabsPlacement);
|
||||
this._config.set('iconMode', this.config.iconMode);
|
||||
this._config.set('backButtonIcon', this.config.backButtonIcon);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,26 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { Config, IonicApp, IonicModule, Platform, NavController } from '../../ionic-angular';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
import { PageTwoModule } from '../pages/page-two/page-two.module';
|
||||
import { PageThreeModule } from '../pages/page-three/page-three.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent, CONFIG_DEMO),
|
||||
PageOneModule,
|
||||
PageTwoModule,
|
||||
PageThreeModule
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
if (!window.localStorage) {
|
||||
Object.defineProperty(window, 'localStorage', new (function () {
|
||||
@@ -19,7 +40,7 @@ if (!window.localStorage) {
|
||||
Object.defineProperty(oStorage, 'setItem', {
|
||||
value: function (sKey: string, sValue: string) {
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=' + encodeURI(sValue) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/';
|
||||
document.cookie = encodeURI(sKey) + '=' + encodeURI(sValue) + '; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
@@ -33,7 +54,7 @@ if (!window.localStorage) {
|
||||
Object.defineProperty(oStorage, 'removeItem', {
|
||||
value: function (sKey: string) {
|
||||
if (!sKey) { return; }
|
||||
document.cookie = encodeURI(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
||||
document.cookie = encodeURI(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=';
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
@@ -70,102 +91,3 @@ var CONFIG_DEMO: any = null;
|
||||
if (window.localStorage.getItem('configDemo')) {
|
||||
CONFIG_DEMO = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'tabs.html'
|
||||
})
|
||||
export class TabPage {
|
||||
tabOne = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
config: any;
|
||||
initialConfig: any;
|
||||
constructor(_config: Config, public navCtrl: NavController) {
|
||||
this.config = _config.settings();
|
||||
this.initialConfig = this.config;
|
||||
}
|
||||
|
||||
|
||||
load() {
|
||||
window.localStorage.setItem('configDemo', JSON.stringify(this.config));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(PushPage);
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'push-page.html'
|
||||
})
|
||||
export class PushPage {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
pop() {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root" #content></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
config: any;
|
||||
root = TabPage;
|
||||
constructor(public _config: Config, public platform: Platform) {
|
||||
|
||||
if (window.localStorage.getItem('configDemo') !== null) {
|
||||
this.config = JSON.parse(window.localStorage.getItem('configDemo'));
|
||||
} else if (platform.is('ios')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
} else if (platform.is('windows')) {
|
||||
this.config = {
|
||||
'backButtonIcon': 'ios-arrow-back',
|
||||
'iconMode': 'ios',
|
||||
'tabsPlacement': 'top'
|
||||
};
|
||||
} else {
|
||||
this.config = {
|
||||
'backButtonIcon': 'md-arrow-back',
|
||||
'iconMode': 'md',
|
||||
'tabsPlacement': 'bottom'
|
||||
};
|
||||
}
|
||||
|
||||
this._config.set('tabsPlacement', this.config.tabsPlacement);
|
||||
this._config.set('iconMode', this.config.iconMode);
|
||||
this._config.set('backButtonIcon', this.config.backButtonIcon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage,
|
||||
PushPage,
|
||||
TabPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp, CONFIG_DEMO)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoPage,
|
||||
PushPage,
|
||||
TabPage
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/config/app/main.ts
Normal file
5
demos/src/config/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/config/pages/page-one/page-one.module.ts
Normal file
17
demos/src/config/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
9
demos/src/config/pages/page-one/page-one.ts
Normal file
9
demos/src/config/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageTwo } from '../page-two/page-two';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
tabOne = PageTwo;
|
||||
}
|
||||
17
demos/src/config/pages/page-three/page-three.module.ts
Normal file
17
demos/src/config/pages/page-three/page-three.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageThree } from './page-three';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageThree,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageThree),
|
||||
],
|
||||
entryComponents: [
|
||||
PageThree,
|
||||
]
|
||||
})
|
||||
export class PageThreeModule {}
|
||||
13
demos/src/config/pages/page-three/page-three.ts
Normal file
13
demos/src/config/pages/page-three/page-three.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { NavController } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-three.html'
|
||||
})
|
||||
export class PageThree {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
pop() {
|
||||
this.navCtrl.pop();
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@
|
||||
<pre margin>
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(MyApp, {
|
||||
backButtonIcon: "{{initialConfig?.backButtonIcon}}"
|
||||
iconMode: "{{initialConfig?.iconMode}}"
|
||||
17
demos/src/config/pages/page-two/page-two.module.ts
Normal file
17
demos/src/config/pages/page-two/page-two.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageTwo } from './page-two';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageTwo,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageTwo),
|
||||
],
|
||||
entryComponents: [
|
||||
PageTwo,
|
||||
]
|
||||
})
|
||||
export class PageTwoModule {}
|
||||
24
demos/src/config/pages/page-two/page-two.ts
Normal file
24
demos/src/config/pages/page-two/page-two.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Config, NavController } from '../../../../../src';
|
||||
import { PageThree } from '../page-three/page-three';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-two.html'
|
||||
})
|
||||
export class PageTwo {
|
||||
config: any;
|
||||
initialConfig: any;
|
||||
constructor(_config: Config, public navCtrl: NavController) {
|
||||
this.config = _config.settings();
|
||||
this.initialConfig = this.config;
|
||||
}
|
||||
|
||||
load() {
|
||||
window.localStorage.setItem('configDemo', JSON.stringify(this.config));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
push() {
|
||||
this.navCtrl.push(PageThree);
|
||||
}
|
||||
}
|
||||
11
demos/src/config/pages/push-page.html
Normal file
11
demos/src/config/pages/push-page.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Page</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div padding>
|
||||
<button ion-button block (click)="pop()">Go Back to Config</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
9
demos/src/datetime/app/app.component.ts
Normal file
9
demos/src/datetime/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/datetime/app/app.module.ts
Normal file
19
demos/src/datetime/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/datetime/app/main.ts
Normal file
5
demos/src/datetime/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/datetime/pages/page-one/page-one.module.ts
Normal file
17
demos/src/datetime/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
@@ -1,11 +1,9 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
export class PageOne {
|
||||
wwwReleased = '1991';
|
||||
netscapeReleased = '1994-12-15T13:47:20.789';
|
||||
operaReleased = '1995-04-15';
|
||||
@@ -40,7 +38,7 @@ export class ApiDemoPage {
|
||||
}
|
||||
}
|
||||
|
||||
calculateTime(offset) {
|
||||
calculateTime(offset: any) {
|
||||
// create Date object for current location
|
||||
let d = new Date();
|
||||
|
||||
@@ -52,37 +50,13 @@ export class ApiDemoPage {
|
||||
}
|
||||
|
||||
// Determine if the client uses DST
|
||||
stdTimezoneOffset(today) {
|
||||
stdTimezoneOffset(today: any) {
|
||||
let jan = new Date(today.getFullYear(), 0, 1);
|
||||
let jul = new Date(today.getFullYear(), 6, 1);
|
||||
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
|
||||
}
|
||||
|
||||
dst(today) {
|
||||
dst(today: any) {
|
||||
return today.getTimezoneOffset() < this.stdTimezoneOffset(today);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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 {}
|
||||
@@ -1,89 +0,0 @@
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { Events, IonicApp, IonicModule, Nav } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'login.html'
|
||||
})
|
||||
export class Login {
|
||||
user = {
|
||||
name: 'Administrator',
|
||||
username: 'admin'
|
||||
};
|
||||
|
||||
constructor(private events: Events) {}
|
||||
|
||||
login() {
|
||||
this.events.publish('user:login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'logout.html'
|
||||
})
|
||||
export class Logout {
|
||||
constructor(private events: Events) {}
|
||||
|
||||
logout() {
|
||||
this.events.publish('user:logout');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.html'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
root = Login;
|
||||
loggedIn = false;
|
||||
|
||||
loggedInPages = [
|
||||
{ title: 'Logout', component: Logout }
|
||||
];
|
||||
|
||||
loggedOutPages = [
|
||||
{ title: 'Login', component: Login }
|
||||
];
|
||||
|
||||
constructor(private events: Events) {
|
||||
this.listenToLoginEvents();
|
||||
}
|
||||
|
||||
openPage(menu, page) {
|
||||
// find the nav component and set what the root page should be
|
||||
// reset the nav to remove previous pages and only have this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
this.nav.setRoot(page.component);
|
||||
}
|
||||
|
||||
listenToLoginEvents() {
|
||||
this.events.subscribe('user:login', () => {
|
||||
this.loggedIn = true;
|
||||
});
|
||||
|
||||
this.events.subscribe('user:logout', () => {
|
||||
this.loggedIn = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
Login,
|
||||
Logout
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
Login,
|
||||
Logout
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
45
demos/src/events/app/app.component.ts
Normal file
45
demos/src/events/app/app.component.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { Events, Nav } from '../../../../src';
|
||||
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
import { PageTwo } from '../pages/page-two/page-two';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.component.html'
|
||||
})
|
||||
export class AppComponent {
|
||||
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
root = PageOne;
|
||||
loggedIn = false;
|
||||
|
||||
loggedInPages = [
|
||||
{ title: 'Logout', component: PageTwo }
|
||||
];
|
||||
|
||||
loggedOutPages = [
|
||||
{ title: 'Login', component: PageOne }
|
||||
];
|
||||
|
||||
constructor(private events: Events) {
|
||||
this.listenToLoginEvents();
|
||||
}
|
||||
|
||||
openPage(menu: any, page: any) {
|
||||
// find the nav component and set what the root page should be
|
||||
// reset the nav to remove previous pages and only have this page
|
||||
// we wouldn't want the back button to show in this scenario
|
||||
this.nav.setRoot(page.component);
|
||||
}
|
||||
|
||||
listenToLoginEvents() {
|
||||
this.events.subscribe('user:login', () => {
|
||||
this.loggedIn = true;
|
||||
});
|
||||
|
||||
this.events.subscribe('user:logout', () => {
|
||||
this.loggedIn = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
21
demos/src/events/app/app.module.ts
Normal file
21
demos/src/events/app/app.module.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
import { PageTwoModule } from '../pages/page-two/page-two.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule,
|
||||
PageTwoModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/events/app/main.ts
Normal file
5
demos/src/events/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/events/pages/page-one/page-one.module.ts
Normal file
17
demos/src/events/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
18
demos/src/events/pages/page-one/page-one.ts
Normal file
18
demos/src/events/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Events } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
user = {
|
||||
name: 'Administrator',
|
||||
username: 'admin'
|
||||
};
|
||||
|
||||
constructor(private events: Events) {}
|
||||
|
||||
login() {
|
||||
this.events.publish('user:login');
|
||||
}
|
||||
}
|
||||
17
demos/src/events/pages/page-two/page-two.module.ts
Normal file
17
demos/src/events/pages/page-two/page-two.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageTwo } from './page-two';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageTwo,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageTwo),
|
||||
],
|
||||
entryComponents: [
|
||||
PageTwo,
|
||||
]
|
||||
})
|
||||
export class PageTwoModule {}
|
||||
13
demos/src/events/pages/page-two/page-two.ts
Normal file
13
demos/src/events/pages/page-two/page-two.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Events } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-two.html'
|
||||
})
|
||||
export class PageTwo {
|
||||
constructor(private events: Events) {}
|
||||
|
||||
logout() {
|
||||
this.events.publish('user:logout');
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { FabContainer, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
array: number[] = [];
|
||||
|
||||
add() {
|
||||
this.array.push(1);
|
||||
}
|
||||
|
||||
clickMainFAB() {
|
||||
console.log('Clicked open social menu');
|
||||
}
|
||||
|
||||
openSocial(network: string, fab: FabContainer) {
|
||||
console.log('Share in ' + network);
|
||||
fab.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@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 {}
|
||||
|
||||
9
demos/src/fab/app/app.component.ts
Normal file
9
demos/src/fab/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/fab/app/app.module.ts
Normal file
19
demos/src/fab/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/fab/app/main.ts
Normal file
5
demos/src/fab/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/fab/pages/page-one/page-one.module.ts
Normal file
17
demos/src/fab/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
22
demos/src/fab/pages/page-one/page-one.ts
Normal file
22
demos/src/fab/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FabContainer } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
array: number[] = [];
|
||||
|
||||
add() {
|
||||
this.array.push(1);
|
||||
}
|
||||
|
||||
clickMainFAB() {
|
||||
console.log('Clicked open social menu');
|
||||
}
|
||||
|
||||
openSocial(network: string, fab: FabContainer) {
|
||||
console.log('Share in ' + network);
|
||||
fab.close();
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/hide-when/app/app.component.ts
Normal file
9
demos/src/hide-when/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/hide-when/app/app.module.ts
Normal file
19
demos/src/hide-when/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/hide-when/app/main.ts
Normal file
5
demos/src/hide-when/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/hide-when/pages/page-one/page-one.module.ts
Normal file
17
demos/src/hide-when/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
6
demos/src/hide-when/pages/page-one/page-one.ts
Normal file
6
demos/src/hide-when/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/icon/app/app.component.ts
Normal file
9
demos/src/icon/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/icon/app/app.module.ts
Normal file
19
demos/src/icon/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/icon/app/main.ts
Normal file
5
demos/src/icon/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
17
demos/src/icon/pages/page-one/page-one.module.ts
Normal file
17
demos/src/icon/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
6
demos/src/icon/pages/page-one/page-one.ts
Normal file
6
demos/src/icon/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {}
|
||||
@@ -1,117 +0,0 @@
|
||||
import { Component, Injectable, NgModule } from '@angular/core';
|
||||
import { InfiniteScroll, IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
/**
|
||||
* Mock Data Access Object
|
||||
**/
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data = [];
|
||||
for (var i = 0; i < 20; i++) {
|
||||
data.push( this._getRandomData() );
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
||||
setTimeout(() => {
|
||||
resolve(this.getData());
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private _getRandomData() {
|
||||
let i = Math.floor( Math.random() * this._data.length );
|
||||
return this._data[i];
|
||||
}
|
||||
|
||||
private _data = [
|
||||
'Fast Times at Ridgemont High',
|
||||
'Peggy Sue Got Married',
|
||||
'Raising Arizona',
|
||||
'Moonstruck',
|
||||
'Fire Birds',
|
||||
'Honeymoon in Vegas',
|
||||
'Amos & Andrew',
|
||||
'It Could Happen to You',
|
||||
'Trapped in Paradise',
|
||||
'Leaving Las Vegas',
|
||||
'The Rock',
|
||||
'Con Air',
|
||||
'Face/Off',
|
||||
'City of Angels',
|
||||
'Gone in Sixty Seconds',
|
||||
'The Family Man',
|
||||
'Windtalkers',
|
||||
'Matchstick Men',
|
||||
'National Treasure',
|
||||
'Ghost Rider',
|
||||
'Grindhouse',
|
||||
'Next',
|
||||
'Kick-Ass',
|
||||
'Drive Angry',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {
|
||||
items: string[];
|
||||
|
||||
constructor(private mockProvider: MockProvider) {
|
||||
this.items = mockProvider.getData();
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll: InfiniteScroll) {
|
||||
this.mockProvider.getAsyncData().then((newData) => {
|
||||
for (var i = 0; i < newData.length; i++) {
|
||||
this.items.push( newData[i] );
|
||||
}
|
||||
|
||||
infiniteScroll.complete();
|
||||
|
||||
if (this.items.length > 90) {
|
||||
infiniteScroll.enable(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="rootPage"></ion-nav>'
|
||||
})
|
||||
export class ApiDemoApp {
|
||||
rootPage = ApiDemoPage;
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(ApiDemoApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
ApiDemoApp,
|
||||
ApiDemoPage
|
||||
],
|
||||
providers: [
|
||||
MockProvider
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
9
demos/src/infinite-scroll/app/app.component.ts
Normal file
9
demos/src/infinite-scroll/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/infinite-scroll/app/app.module.ts
Normal file
19
demos/src/infinite-scroll/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/infinite-scroll/app/main.ts
Normal file
5
demos/src/infinite-scroll/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
21
demos/src/infinite-scroll/pages/page-one/page-one.module.ts
Normal file
21
demos/src/infinite-scroll/pages/page-one/page-one.module.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
import { MockProvider } from './provider';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
],
|
||||
providers: [
|
||||
MockProvider
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
||||
28
demos/src/infinite-scroll/pages/page-one/page-one.ts
Normal file
28
demos/src/infinite-scroll/pages/page-one/page-one.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MockProvider} from './provider';
|
||||
import { InfiniteScroll } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
items: string[];
|
||||
|
||||
constructor(private mockProvider: MockProvider) {
|
||||
this.items = mockProvider.getData();
|
||||
}
|
||||
|
||||
doInfinite(infiniteScroll: InfiniteScroll) {
|
||||
this.mockProvider.getAsyncData().then((newData) => {
|
||||
for (var i = 0; i < newData.length; i++) {
|
||||
this.items.push( newData[i] );
|
||||
}
|
||||
|
||||
infiniteScroll.complete();
|
||||
|
||||
if (this.items.length > 90) {
|
||||
infiniteScroll.enable(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
58
demos/src/infinite-scroll/pages/page-one/provider.ts
Normal file
58
demos/src/infinite-scroll/pages/page-one/provider.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class MockProvider {
|
||||
|
||||
getData(): any[] {
|
||||
// return mock data synchronously
|
||||
let data: any[] = [];
|
||||
for (var i = 0; i < 20; i++) {
|
||||
data.push( this._getRandomData() );
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
getAsyncData(): Promise<any[]> {
|
||||
// async receive mock data
|
||||
return new Promise(resolve => {
|
||||
|
||||
setTimeout(() => {
|
||||
resolve(this.getData());
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private _getRandomData() {
|
||||
let i = Math.floor( Math.random() * this._data.length );
|
||||
return this._data[i];
|
||||
}
|
||||
|
||||
private _data = [
|
||||
'Fast Times at Ridgemont High',
|
||||
'Peggy Sue Got Married',
|
||||
'Raising Arizona',
|
||||
'Moonstruck',
|
||||
'Fire Birds',
|
||||
'Honeymoon in Vegas',
|
||||
'Amos & Andrew',
|
||||
'It Could Happen to You',
|
||||
'Trapped in Paradise',
|
||||
'Leaving Las Vegas',
|
||||
'The Rock',
|
||||
'Con Air',
|
||||
'Face/Off',
|
||||
'City of Angels',
|
||||
'Gone in Sixty Seconds',
|
||||
'The Family Man',
|
||||
'Windtalkers',
|
||||
'Matchstick Men',
|
||||
'National Treasure',
|
||||
'Ghost Rider',
|
||||
'Grindhouse',
|
||||
'Next',
|
||||
'Kick-Ass',
|
||||
'Drive Angry',
|
||||
];
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule } from '../../ionic-angular';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page.html'
|
||||
})
|
||||
export class ApiDemoPage {}
|
||||
|
||||
|
||||
@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 {}
|
||||
9
demos/src/input/app/app.component.ts
Normal file
9
demos/src/input/app/app.component.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
||||
19
demos/src/input/app/app.module.ts
Normal file
19
demos/src/input/app/app.module.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
5
demos/src/input/app/main.ts
Normal file
5
demos/src/input/app/main.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user