mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d49e10da4 | ||
|
|
ce46c24413 | ||
|
|
f7fce5fa16 | ||
|
|
d23b9f7d49 | ||
|
|
4c13535416 | ||
|
|
889b49f372 | ||
|
|
acb6facc7b | ||
|
|
2153940de8 | ||
|
|
6d8da0ae32 | ||
|
|
347c260950 | ||
|
|
9ffc52b582 | ||
|
|
08be9dc58b | ||
|
|
ad25cd1cd7 | ||
|
|
693c1c56d1 | ||
|
|
b5aa304e7e | ||
|
|
3e3a00b2fb | ||
|
|
923e3b2e26 | ||
|
|
e079f7777f | ||
|
|
5a4b351794 | ||
|
|
d22d77b485 | ||
|
|
efd54750bf | ||
|
|
eb830d4202 | ||
|
|
3f39e14f76 | ||
|
|
fce4422ab1 | ||
|
|
04e78d8c22 | ||
|
|
48b3243689 | ||
|
|
486bff036d | ||
|
|
a7e5fa7ea7 | ||
|
|
5771543c3b | ||
|
|
048af1b329 | ||
|
|
a92d805e89 | ||
|
|
8dc08f9c1f | ||
|
|
bc7bb21f1a | ||
|
|
016b90da47 | ||
|
|
0f5c47db15 | ||
|
|
86495e111d | ||
|
|
fba6ff0638 | ||
|
|
30f69c8a16 | ||
|
|
1beef75c80 | ||
|
|
58e1d79518 | ||
|
|
0480f73f8e | ||
|
|
f39c3811c5 | ||
|
|
6f7acdbddf | ||
|
|
bcc85d9144 | ||
|
|
00fbded168 | ||
|
|
5cad96570f | ||
|
|
e3a8d27ec1 | ||
|
|
d8b65da6ac |
108
CHANGELOG.md
108
CHANGELOG.md
@@ -1,10 +1,114 @@
|
||||
<a name="3.5.2"></a>
|
||||
## [3.5.2](https://github.com/ionic-team/ionic/compare/v3.5.1...v3.5.2) (2017-07-13)
|
||||
|
||||
## Upgrade Instructions
|
||||
`ionic-angular@3.5.2` is a drop-in replacement for `3.5.1`. To install it, simply run `npm install ionic-angular@3.5.2 --save --save-exact`.
|
||||
|
||||
We have released a new version of our build process for `ionic-angular` apps, `@ionic/app-scripts` in conjunction with this release of `ionic-angular`. While it's not a required update, we recommend it because we have greatly improved the developer experience. Incremental, or update builds while developing are much faster now. We've also added `scope hoisting` for better start-up performance on production builds.
|
||||
|
||||
To upgrade to `@ionic/app-scripts`, run the following command:
|
||||
|
||||
```
|
||||
rm -rf node_modules
|
||||
npm install @ionic/app-scripts@2.0.2 --save-dev --save-exact
|
||||
```
|
||||
|
||||
After installing the update, you'll need to make a minor change to the `src/index.html` file to include a new `<script>` tag for `build/vendor.js`. The reason for this breaking change in `@ionic/app-scripts` is for faster builds. By separating out the `node_modules` dependencies into a `vendor.js` file, the incremental build is faster.
|
||||
|
||||
```
|
||||
...
|
||||
<body>
|
||||
|
||||
<!-- Ionic's root component and where the app will load -->
|
||||
<ion-app></ion-app>
|
||||
|
||||
<!-- cordova.js required for cordova apps -->
|
||||
<script src="cordova.js"></script>
|
||||
|
||||
<!-- The polyfills js is generated during the build process -->
|
||||
<script src="build/polyfills.js"></script>
|
||||
|
||||
<!-- The vendor js is generated during the build process
|
||||
and includes all files in the node_modules directory -->
|
||||
<script src="build/vendor.js"></script>
|
||||
|
||||
<!-- The bundle js is generated during the build process -->
|
||||
<script src="build/main.js"></script>
|
||||
|
||||
</body>
|
||||
...
|
||||
```
|
||||
|
||||
If you're customizing `@ionic/app-scripts`, we recommend you review the [changelog](https://github.com/ionic-team/ionic-app-scripts/blob/master/CHANGELOG.md), and update any of your configs accordingly.
|
||||
|
||||
## Notes
|
||||
`3.5.2` is the same as `3.5.1`. We had a small publishing error.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **navigation:** fix swipe-to-go-back ([04e78d8](https://github.com/ionic-team/ionic/commit/04e78d8))
|
||||
* **navigation:** mark as not transitioning on success in addition to '_transitionFinish', provide no ([48b3243](https://github.com/ionic-team/ionic/commit/48b3243))
|
||||
* **navigation:** navs can have n child navs instead of just one ([fce4422](https://github.com/ionic-team/ionic/commit/fce4422))
|
||||
* **navigation:** restore getActiveChildNav method to maintain old API, add deprecation notice ([d22d77b](https://github.com/ionic-team/ionic/commit/d22d77b))
|
||||
* **navigation:** ts2.4 compatibility ([08be9dc](https://github.com/ionic-team/ionic/commit/08be9dc)), closes [#12233](https://github.com/ionic-team/ionic/issues/12233) [#12235](https://github.com/ionic-team/ionic/issues/12235)
|
||||
* **select:** not activated on enter in input field ([ad25cd1](https://github.com/ionic-team/ionic/commit/ad25cd1)), closes [#12202](https://github.com/ionic-team/ionic/issues/12202)
|
||||
* **sliding-item:** ionSwipe event is fired ([#12157](https://github.com/ionic-team/ionic/issues/12157)) ([b5aa304](https://github.com/ionic-team/ionic/commit/b5aa304)), closes [#12146](https://github.com/ionic-team/ionic/issues/12146)
|
||||
* **tabs:** have tabs behavior match nav when navigating back/forth via the url ([3f39e14](https://github.com/ionic-team/ionic/commit/3f39e14))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **navigation:** support for named ion-nav/ion-tabs to improve url in the short term ([486bff0](https://github.com/ionic-team/ionic/commit/486bff0))
|
||||
|
||||
|
||||
<a name="3.5.1"></a>
|
||||
## [3.5.1](https://github.com/ionic-team/ionic/compare/v3.5.0...v3.5.1) (2017-07-13)
|
||||
|
||||
See the [3.5.2](https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#352-2017-07-13) changelog. We had a publishing error here.
|
||||
|
||||
<a name="3.5.0"></a>
|
||||
# [3.5.0](https://github.com/ionic-team/ionic/compare/v3.4.2...v3.5.0) (2017-06-28)
|
||||
|
||||
### Steps to Upgrade
|
||||
|
||||
`ionic-angular` should be set to version `3.5.0`.
|
||||
|
||||
```
|
||||
npm install ionic-angular@3.5.0 --save --save-exact
|
||||
```
|
||||
|
||||
### Notes
|
||||
There were major improvements made to navigation in this release of `ionic-angular`. Specifically, we updated Ionic to support a concept of `n` root navigation elements, instead of just one. This will enable first-class url support for things `split-pane`. Before `3.5.0`, only one section of the screen could be represented in the URL. With these changes, multiple sections can be. Another large change was improving the behavior surrounding browser behaviors, such as the back-and-forward buttons, as well as refresh. In general, Ionic should work much more intuitively in a web browser now.
|
||||
|
||||
As a result of these improvements, if you're using deep linking, the urls of the application will be different with `3.5.0` than they were with previous Ionic releases. The URLs will likely change again in the near future with the next round of navigation improvements too. For now, we don't recommend using `href` attributes in the application. Using the `navPush` and `navPop` directives is a better option for now while URL support is being built-out.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **navigation:** add isTab check to getSegmentsFromNav ([f39c381](https://github.com/ionic-team/ionic/commit/f39c381))
|
||||
* **navigation:** fallback to name if component does not exist on segment ([30f69c8](https://github.com/ionic-team/ionic/commit/30f69c8))
|
||||
* **select:** _inputUpdated should not be called manually ([8dc08f9](https://github.com/ionic-team/ionic/commit/8dc08f9))
|
||||
* **select:** floating label ([e3a8d27](https://github.com/ionic-team/ionic/commit/e3a8d27)), closes [#12068](https://github.com/ionic-team/ionic/issues/12068)
|
||||
* **tabs:** use segment if it exists even if component exists ([016b90d](https://github.com/ionic-team/ionic/commit/016b90d))
|
||||
|
||||
|
||||
|
||||
<a name="3.4.2"></a>
|
||||
## [3.4.2](https://github.com/ionic-team/ionic/compare/v3.4.1...v3.4.2) (2017-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **rtl:** use multi direction in order to override the default ltr ([70b5b6](https://github.com/ionic-team/ionic/commit/70b5b6))
|
||||
|
||||
|
||||
|
||||
<a name="3.4.1"></a>
|
||||
## [3.4.1](https://github.com/ionic-team/ionic/compare/v3.4.0...v3.4.1) (2017-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **themes:** change default app-direction ([ce92be0](https://github.com/ionic-team/ionic/commit/ce92be0))
|
||||
* **themes:** change default app-direction ([1ca7df](https://github.com/ionic-team/ionic/commit/1ca7df))
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +133,7 @@
|
||||
"@ionic-native/splash-screen": "3.12.1",
|
||||
"@ionic-native/status-bar": "3.12.1",
|
||||
"@ionic/storage": "2.0.1",
|
||||
"ionic-angular": "3.4.1",
|
||||
"ionic-angular": "3.4.2",
|
||||
"ionicons": "3.0.0",
|
||||
"rxjs": "5.4.0",
|
||||
"sw-toolbox": "3.6.0",
|
||||
|
||||
@@ -58,13 +58,13 @@ export class PageOne {
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancel',
|
||||
handler: (data) => {
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Save',
|
||||
handler: (data) => {
|
||||
handler: () => {
|
||||
console.log('Saved clicked');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export class AppComponent {
|
||||
this.listenToLoginEvents();
|
||||
}
|
||||
|
||||
openPage(menu: any, page: any) {
|
||||
openPage(_: 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
|
||||
|
||||
@@ -71,7 +71,7 @@ export class PageOne {
|
||||
this.expandAction(item, 'downloading', 'Login was downloaded.');
|
||||
}
|
||||
|
||||
expandAction(item: ItemSliding, action: string, text: string) {
|
||||
expandAction(item: ItemSliding, _: any, text: string) {
|
||||
// TODO item.setElementClass(action, true);
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
14824
package-lock.json
generated
Normal file
14824
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "ionic2",
|
||||
"version": "3.4.1",
|
||||
"version": "3.5.2",
|
||||
"description": "A powerful framework for building mobile and progressive web apps with JavaScript and Angular",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -22,7 +22,8 @@
|
||||
"scripts": {
|
||||
"test": "gulp validate",
|
||||
"test:generators": "jasmine-node ./tooling/spec",
|
||||
"link": "gulp release.prepareReleasePackage && cd dist/ionic-angular && npm link"
|
||||
"link": "gulp release.prepareReleasePackage && cd dist/ionic-angular && npm link",
|
||||
"tsc": "tsc --outdir .tmp"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "4.1.3",
|
||||
@@ -38,7 +39,7 @@
|
||||
"zone.js": "0.8.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ionic/app-scripts": "1.3.7",
|
||||
"@ionic/app-scripts": "^1.3.11",
|
||||
"@ionic/commit-hooks": "1.0.3",
|
||||
"@types/connect": "3.4.30",
|
||||
"@types/del": "2.2.31",
|
||||
@@ -65,6 +66,7 @@
|
||||
"conventional-changelog": "1.1.0",
|
||||
"core-js": "2.4.1",
|
||||
"cpr": "2.0.0",
|
||||
"cross-spawn": "^5.1.0",
|
||||
"del": "2.2.2",
|
||||
"dgeni": "^0.4.7",
|
||||
"dgeni-packages": "^0.16.10",
|
||||
@@ -91,7 +93,7 @@
|
||||
"gulp-scss-lint": "0.4.0",
|
||||
"gulp-shell": "0.5.2",
|
||||
"gulp-strip-debug": "1.1.0",
|
||||
"gulp-tslint": "6.1.1",
|
||||
"gulp-tslint": "^8.1.1",
|
||||
"gulp-typescript": "2.13.6",
|
||||
"gulp-uglify": "2.0.0",
|
||||
"gulp-util": "3.0.7",
|
||||
@@ -130,8 +132,8 @@
|
||||
"systemjs": "0.19.38",
|
||||
"through2": "2.0.1",
|
||||
"ts-node": "1.3.0",
|
||||
"tslint": "3.15.1",
|
||||
"tslint-ionic-rules": "0.0.8",
|
||||
"tslint": "^5.4.3",
|
||||
"tslint-ionic-rules": "0.0.11",
|
||||
"typescript": "~2.3.3",
|
||||
"vinyl": "1.2.0",
|
||||
"webpack": "^2.1.0-beta.27",
|
||||
|
||||
@@ -7,7 +7,7 @@ path: ""
|
||||
category: api
|
||||
id: api
|
||||
title: Javascript
|
||||
header_sub_title: Extend Ionic even further with the power of AngularJS
|
||||
header_sub_title: Extend Ionic even further with the power of Angular
|
||||
searchable: false
|
||||
---
|
||||
|
||||
@@ -15,9 +15,6 @@ searchable: false
|
||||
|
||||
<img class="section-header" src="/img/docs/api-intro-header.png" />
|
||||
|
||||
|
||||
Ionic takes everything you know and loved about Ionic V1, and builds on top of it to provide a much more flexible framework.
|
||||
|
||||
In the API docs, you'll find two kinds of doc pages: Component and Service APIs.
|
||||
|
||||
The Component APIs include classes like `Checkbox`, `Toggle` or `Item` and show you how to use them, in addition to listing their selectors, available properties and events.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { exec, spawnSync, spawn } from 'child_process';
|
||||
import { exec, spawnSync } from 'child_process';
|
||||
import { spawn } from 'cross-spawn';
|
||||
import { writeFileSync } from 'fs';
|
||||
import * as changelog from 'conventional-changelog';
|
||||
import * as GithubApi from 'github';
|
||||
|
||||
@@ -50,6 +50,15 @@ export function createTempTsConfig(includeGlob: string[], target: string, module
|
||||
if (config.compilerOptions && config.compilerOptions.outDir) {
|
||||
delete config.compilerOptions.outDir;
|
||||
}
|
||||
|
||||
// remove linting checks that we do not want in dist
|
||||
if (config.compilerOptions.noUnusedLocals) {
|
||||
delete config.compilerOptions.noUnusedLocals;
|
||||
}
|
||||
if (config.compilerOptions.noUnusedParameters) {
|
||||
delete config.compilerOptions.noUnusedParameters;
|
||||
}
|
||||
|
||||
if (config.compilerOptions) {
|
||||
config.compilerOptions.module = moduleType;
|
||||
config.compilerOptions.target = target;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
import { NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
/**
|
||||
* Generated class for the $CLASSNAME page.
|
||||
@@ -7,7 +7,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
* See http://ionicframework.com/docs/components/#navigation for more info
|
||||
* on Ionic pages and navigation.
|
||||
*/
|
||||
@IonicPage()
|
||||
|
||||
@Component({
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController } from 'ionic-angular';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
/**
|
||||
* Generated class for the $CLASSNAME tabs.
|
||||
@@ -11,7 +11,6 @@ import { IonicPage, NavController } from 'ionic-angular';
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html'
|
||||
})
|
||||
@IonicPage()
|
||||
export class $CLASSNAME {
|
||||
|
||||
$TAB_VARIABLES
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { isDefined, assert } from '../util/util';
|
||||
import { assert, isDefined } from '../util/util';
|
||||
import { Platform } from '../platform/platform';
|
||||
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -48,12 +47,12 @@ export class Animation {
|
||||
if (ele) {
|
||||
if (typeof ele === 'string') {
|
||||
ele = this.plt.doc().querySelectorAll(ele);
|
||||
for (var i = 0; i < ele.length; i++) {
|
||||
for (let i = 0; i < ele.length; i++) {
|
||||
this._addEle(ele[i]);
|
||||
}
|
||||
|
||||
} else if (ele.length) {
|
||||
for (var i = 0; i < ele.length; i++) {
|
||||
for (let i = 0; i < ele.length; i++) {
|
||||
this._addEle(ele[i]);
|
||||
}
|
||||
|
||||
@@ -194,7 +193,7 @@ export class Animation {
|
||||
|
||||
if (!fxProp) {
|
||||
// first time we've see this EffectProperty
|
||||
var shouldTrans = (ANIMATION_TRANSFORMS[prop] === 1);
|
||||
const shouldTrans = (ANIMATION_TRANSFORMS[prop] === 1);
|
||||
fxProp = {
|
||||
name: prop,
|
||||
trans: shouldTrans,
|
||||
@@ -262,7 +261,7 @@ export class Animation {
|
||||
*/
|
||||
beforeClearStyles(propertyNames: string[]): Animation {
|
||||
this._bfSty = this._bfSty || {};
|
||||
for (var i = 0; i < propertyNames.length; i++) {
|
||||
for (let i = 0; i < propertyNames.length; i++) {
|
||||
this._bfSty[propertyNames[i]] = '';
|
||||
}
|
||||
return this;
|
||||
@@ -319,7 +318,7 @@ export class Animation {
|
||||
*/
|
||||
afterClearStyles(propertyNames: string[]): Animation {
|
||||
this._afSty = this._afSty || {};
|
||||
for (var i = 0; i < propertyNames.length; i++) {
|
||||
for (let i = 0; i < propertyNames.length; i++) {
|
||||
this._afSty[propertyNames[i]] = '';
|
||||
}
|
||||
return this;
|
||||
@@ -386,7 +385,7 @@ export class Animation {
|
||||
this._hasDur = (this.getDuration(opts) > ANIMATION_DURATION_MIN);
|
||||
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._playInit(opts);
|
||||
}
|
||||
@@ -441,7 +440,7 @@ export class Animation {
|
||||
*/
|
||||
_playProgress(opts: PlayOptions) {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._playProgress(opts);
|
||||
}
|
||||
@@ -474,7 +473,7 @@ export class Animation {
|
||||
*/
|
||||
_playToStep(stepValue: number) {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._playToStep(stepValue);
|
||||
}
|
||||
@@ -546,7 +545,7 @@ export class Animation {
|
||||
*/
|
||||
_playEnd(stepValue?: number) {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._playEnd(stepValue);
|
||||
}
|
||||
@@ -583,7 +582,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
if (children[i]._hasDuration(opts)) {
|
||||
return true;
|
||||
}
|
||||
@@ -602,7 +601,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
if (children[i]._hasDomReads()) {
|
||||
return true;
|
||||
}
|
||||
@@ -650,16 +649,16 @@ export class Animation {
|
||||
if (this._rv) {
|
||||
stepValue = ((stepValue * -1) + 1);
|
||||
}
|
||||
var i: number, j: number;
|
||||
var finalTransform: string = '';
|
||||
var elements = this._e;
|
||||
let i: number, j: number;
|
||||
let finalTransform: string = '';
|
||||
const elements = this._e;
|
||||
for (i = 0; i < effects.length; i++) {
|
||||
var fx = effects[i];
|
||||
const fx = effects[i];
|
||||
|
||||
if (fx.from && fx.to) {
|
||||
var fromNum = fx.from.num;
|
||||
var toNum = fx.to.num;
|
||||
var tweenEffect = (fromNum !== toNum);
|
||||
const fromNum = fx.from.num;
|
||||
const toNum = fx.to.num;
|
||||
const tweenEffect = (fromNum !== toNum);
|
||||
|
||||
assert(tweenEffect || !this._isAsync, 'in async animations to != from value');
|
||||
if (tweenEffect) {
|
||||
@@ -676,8 +675,8 @@ export class Animation {
|
||||
|
||||
} else if (tweenEffect) {
|
||||
// EVERYTHING IN BETWEEN
|
||||
var valNum = (((toNum - fromNum) * stepValue) + fromNum);
|
||||
var unit = fx.to.unit;
|
||||
let valNum = (((toNum - fromNum) * stepValue) + fromNum);
|
||||
const unit = fx.to.unit;
|
||||
if (unit === 'px') {
|
||||
valNum = Math.round(valNum);
|
||||
}
|
||||
@@ -685,7 +684,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
if (val !== null) {
|
||||
var prop = fx.name;
|
||||
const prop = fx.name;
|
||||
if (fx.trans) {
|
||||
finalTransform += prop + '(' + val + ') ';
|
||||
|
||||
@@ -705,7 +704,7 @@ export class Animation {
|
||||
finalTransform += 'translateZ(0px)';
|
||||
}
|
||||
|
||||
var cssTransform = this.plt.Css.transform;
|
||||
const cssTransform = this.plt.Css.transform;
|
||||
for (i = 0; i < elements.length; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
(<any>elements[i].style)[cssTransform] = finalTransform;
|
||||
@@ -734,7 +733,7 @@ export class Animation {
|
||||
const cssTransitionTimingFn = Css.transitionTimingFn;
|
||||
|
||||
let eleStyle: any;
|
||||
for (var i = 0; i < this._eL; i++) {
|
||||
for (let i = 0; i < this._eL; i++) {
|
||||
eleStyle = elements[i].style;
|
||||
if (dur > 0) {
|
||||
// ******** DOM WRITE ****************
|
||||
@@ -836,14 +835,14 @@ export class Animation {
|
||||
*/
|
||||
_fireBeforeReadFunc() {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM READ ****************
|
||||
children[i]._fireBeforeReadFunc();
|
||||
}
|
||||
|
||||
const readFunctions = this._rdFn;
|
||||
if (readFunctions) {
|
||||
for (var i = 0; i < readFunctions.length; i++) {
|
||||
for (let i = 0; i < readFunctions.length; i++) {
|
||||
// ******** DOM READ ****************
|
||||
readFunctions[i]();
|
||||
}
|
||||
@@ -857,14 +856,14 @@ export class Animation {
|
||||
*/
|
||||
_fireBeforeWriteFunc() {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._fireBeforeWriteFunc();
|
||||
}
|
||||
|
||||
const writeFunctions = this._wrFn;
|
||||
if (this._wrFn) {
|
||||
for (var i = 0; i < writeFunctions.length; i++) {
|
||||
for (let i = 0; i < writeFunctions.length; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
writeFunctions[i]();
|
||||
}
|
||||
@@ -909,7 +908,7 @@ export class Animation {
|
||||
|
||||
// inline styles that were added before the animation should be removed
|
||||
if (this._bfSty) {
|
||||
for (var prop in this._bfSty) {
|
||||
for (const prop in this._bfSty) {
|
||||
// ******** DOM WRITE ****************
|
||||
(<any>ele).style[prop] = '';
|
||||
}
|
||||
@@ -936,7 +935,7 @@ export class Animation {
|
||||
|
||||
// inline styles to add after the animation
|
||||
if (this._afSty) {
|
||||
for (var prop in this._afSty) {
|
||||
for (const prop in this._afSty) {
|
||||
// ******** DOM WRITE ****************
|
||||
(<any>ele).style[prop] = this._afSty[prop];
|
||||
}
|
||||
@@ -956,8 +955,8 @@ export class Animation {
|
||||
let willChange: string;
|
||||
if (addWillChange && effects) {
|
||||
wc = [];
|
||||
for (var i = 0; i < effects.length; i++) {
|
||||
var propWC = effects[i].wc;
|
||||
for (let i = 0; i < effects.length; i++) {
|
||||
const propWC = effects[i].wc;
|
||||
if (propWC === 'webkitTransform') {
|
||||
wc.push('transform', '-webkit-transform');
|
||||
|
||||
@@ -969,7 +968,7 @@ export class Animation {
|
||||
} else {
|
||||
willChange = '';
|
||||
}
|
||||
for (var i = 0; i < this._eL; i++) {
|
||||
for (let i = 0; i < this._eL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
(<any>this._e[i]).style.willChange = willChange;
|
||||
}
|
||||
@@ -996,7 +995,7 @@ export class Animation {
|
||||
*/
|
||||
_progressStart() {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._progressStart();
|
||||
}
|
||||
@@ -1017,7 +1016,7 @@ export class Animation {
|
||||
stepValue = Math.min(1, Math.max(0, stepValue));
|
||||
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i].progressStep(stepValue);
|
||||
}
|
||||
@@ -1076,7 +1075,7 @@ export class Animation {
|
||||
*/
|
||||
_progressEnd(shouldComplete: boolean, stepValue: number, dur: number, isAsync: boolean) {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
// ******** DOM WRITE ****************
|
||||
children[i]._progressEnd(shouldComplete, stepValue, dur, isAsync);
|
||||
}
|
||||
@@ -1127,7 +1126,7 @@ export class Animation {
|
||||
*/
|
||||
_didFinishAll(hasCompleted: boolean, finishAsyncAnimations: boolean, finishNoDurationAnimations: boolean) {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
children[i]._didFinishAll(hasCompleted, finishAsyncAnimations, finishNoDurationAnimations);
|
||||
}
|
||||
|
||||
@@ -1146,14 +1145,14 @@ export class Animation {
|
||||
|
||||
if (this._fFn) {
|
||||
// run all finish callbacks
|
||||
for (var i = 0; i < this._fFn.length; i++) {
|
||||
for (let i = 0; i < this._fFn.length; i++) {
|
||||
this._fFn[i](this);
|
||||
}
|
||||
}
|
||||
|
||||
if (this._fOneFn) {
|
||||
// run all "onetime" finish callbacks
|
||||
for (var i = 0; i < this._fOneFn.length; i++) {
|
||||
for (let i = 0; i < this._fOneFn.length; i++) {
|
||||
this._fOneFn[i](this);
|
||||
}
|
||||
this._fOneFn.length = 0;
|
||||
@@ -1165,7 +1164,7 @@ export class Animation {
|
||||
*/
|
||||
reverse(shouldReverse: boolean = true): Animation {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
children[i].reverse(shouldReverse);
|
||||
}
|
||||
this._rv = shouldReverse;
|
||||
@@ -1177,7 +1176,7 @@ export class Animation {
|
||||
*/
|
||||
destroy() {
|
||||
const children = this._c;
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
children[i].destroy();
|
||||
}
|
||||
|
||||
@@ -1202,9 +1201,9 @@ export class Animation {
|
||||
*/
|
||||
_transEl(): HTMLElement {
|
||||
// get the lowest level element that has an Animation
|
||||
var targetEl: HTMLElement;
|
||||
let targetEl: HTMLElement;
|
||||
|
||||
for (var i = 0; i < this._cL; i++) {
|
||||
for (let i = 0; i < this._cL; i++) {
|
||||
targetEl = this._c[i]._transEl();
|
||||
if (targetEl) {
|
||||
return targetEl;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { ActionSheetOptions, ActionSheetButton } from './action-sheet-options';
|
||||
import { ActionSheetButton, ActionSheetOptions } from './action-sheet-options';
|
||||
import { assert } from '../../util/util';
|
||||
import { BlockerDelegate, GestureController, BLOCK_ALL } from '../../gestures/gesture-controller';
|
||||
import { BLOCK_ALL, BlockerDelegate, GestureController } from '../../gestures/gesture-controller';
|
||||
import { Config } from '../../config/config';
|
||||
import { KEY_ESCAPE } from '../../platform/key';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { NavParams } from '../../navigation/nav-params';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
@@ -57,7 +56,6 @@ export class ActionSheetCmp {
|
||||
constructor(
|
||||
private _viewCtrl: ViewController,
|
||||
config: Config,
|
||||
private _plt: Platform,
|
||||
private _elementRef: ElementRef,
|
||||
gestureCtrl: GestureController,
|
||||
params: NavParams,
|
||||
|
||||
@@ -13,4 +13,4 @@ export interface ActionSheetButton {
|
||||
icon?: string;
|
||||
cssClass?: string;
|
||||
handler?: () => boolean|void;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ActionSheetCmp } from './action-sheet-component';
|
||||
import { ActionSheetOptions, ActionSheetButton } from './action-sheet-options';
|
||||
import { ActionSheetSlideIn, ActionSheetMdSlideIn, ActionSheetSlideOut, ActionSheetMdSlideOut, ActionSheetWpSlideIn, ActionSheetWpSlideOut } from './action-sheet-transitions';
|
||||
import { ActionSheetButton, ActionSheetOptions } from './action-sheet-options';
|
||||
import { ActionSheetMdSlideIn, ActionSheetMdSlideOut, ActionSheetSlideIn, ActionSheetSlideOut, ActionSheetWpSlideIn, ActionSheetWpSlideOut } from './action-sheet-transitions';
|
||||
import { App } from '../app/app';
|
||||
import { Config } from '../../config/config';
|
||||
import { isPresent } from '../../util/util';
|
||||
|
||||
@@ -2,14 +2,14 @@ import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { NON_TEXT_INPUT_REGEX } from '../../util/dom';
|
||||
import { GestureController, BlockerDelegate, BLOCK_ALL } from '../../gestures/gesture-controller';
|
||||
import { isPresent, assert } from '../../util/util';
|
||||
import { BLOCK_ALL, BlockerDelegate, GestureController } from '../../gestures/gesture-controller';
|
||||
import { assert, isPresent } from '../../util/util';
|
||||
import { KEY_ENTER, KEY_ESCAPE } from '../../platform/key';
|
||||
import { NavParams } from '../../navigation/nav-params';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
import { AlertInputOptions, AlertOptions, AlertButton } from './alert-options';
|
||||
import { AlertButton, AlertInputOptions, AlertOptions } from './alert-options';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,4 +29,4 @@ export interface AlertButton {
|
||||
role?: string;
|
||||
cssClass?: string;
|
||||
handler?: (value: any) => boolean|void;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { App } from '../app/app';
|
||||
import { AlertCmp } from './alert-component';
|
||||
import { AlertOptions, AlertInputOptions, AlertButton } from './alert-options';
|
||||
import { AlertPopIn, AlertPopOut, AlertMdPopIn, AlertMdPopOut, AlertWpPopIn, AlertWpPopOut } from './alert-transitions';
|
||||
import { AlertButton, AlertInputOptions, AlertOptions } from './alert-options';
|
||||
import { AlertMdPopIn, AlertMdPopOut, AlertPopIn, AlertPopOut, AlertWpPopIn, AlertWpPopOut } from './alert-transitions';
|
||||
import { Config } from '../../config/config';
|
||||
import { isPresent } from '../../util/util';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, AlertController, LoadingController, NavController } from '../../../..';
|
||||
import { AlertController, IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
|
||||
import { FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { EventEmitter, Injectable, Optional } from '@angular/core';
|
||||
import { Title, DOCUMENT } from '@angular/platform-browser';
|
||||
import { DOCUMENT, Title } from '@angular/platform-browser';
|
||||
|
||||
import { IonicApp } from './app-root';
|
||||
import * as Constants from './app-constants';
|
||||
import { ClickBlock } from './click-block';
|
||||
import { runInDev, assert } from '../../util/util';
|
||||
import { assert, runInDev } from '../../util/util';
|
||||
import { Config } from '../../config/config';
|
||||
import { isNav, NavOptions, DIRECTION_FORWARD, DIRECTION_BACK } from '../../navigation/nav-util';
|
||||
import { DIRECTION_BACK, DIRECTION_FORWARD, NavOptions, isTabs } from '../../navigation/nav-util';
|
||||
import { MenuController } from './menu-controller';
|
||||
import { NavController } from '../../navigation/nav-controller';
|
||||
import { NavigationContainer } from '../../navigation/navigation-container';
|
||||
import { NavControllerBase } from '../../navigation/nav-controller-base';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
import { IOSTransition } from '../../transitions/transition-ios';
|
||||
@@ -28,7 +29,7 @@ export class App {
|
||||
private _scrollTime: number = 0;
|
||||
private _title: string = '';
|
||||
private _titleSrv: Title = new Title(DOCUMENT);
|
||||
private _rootNav: NavController = null;
|
||||
private _rootNavs = new Map<string, NavigationContainer>();
|
||||
private _disableScrollAssist: boolean;
|
||||
private _didScroll = false;
|
||||
|
||||
@@ -205,28 +206,82 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {NavController} Returns the active NavController. Using this method is preferred when we need access to the top-level navigation controller while on the outside views and handlers like `registerBackButtonAction()`
|
||||
* @return {NavController} Returns the first Active Nav Controller from the list. This method is deprecated
|
||||
*/
|
||||
getActiveNav(): NavController {
|
||||
getActiveNav(): NavControllerBase {
|
||||
console.warn('(getActiveNav) is deprecated and will be removed in the next major release. Use getActiveNavs instead.');
|
||||
const navs = this.getActiveNavs();
|
||||
if (navs && navs.length) {
|
||||
return navs[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {NavController[]} Returns the active NavControllers. Using this method is preferred when we need access to the top-level navigation controller while on the outside views and handlers like `registerBackButtonAction()`
|
||||
*/
|
||||
getActiveNavs(rootNavId?: string): NavControllerBase[] {
|
||||
const portal = this._appRoot._getPortal(Constants.PORTAL_MODAL);
|
||||
if (portal.length() > 0) {
|
||||
return findTopNav(portal);
|
||||
return <NavControllerBase[]> findTopNavs(portal);
|
||||
}
|
||||
return findTopNav(this._rootNav || null);
|
||||
if (!this._rootNavs || !this._rootNavs.size) {
|
||||
return [];
|
||||
}
|
||||
if (this._rootNavs.size === 1) {
|
||||
return <NavControllerBase[]> findTopNavs(this._rootNavs.values().next().value);
|
||||
}
|
||||
if (rootNavId) {
|
||||
return <NavControllerBase[]> findTopNavs(this._rootNavs.get(rootNavId));
|
||||
}
|
||||
// fallback to just using all root names
|
||||
let activeNavs: NavigationContainer[] = [];
|
||||
this._rootNavs.forEach(nav => {
|
||||
const topNavs = findTopNavs(nav);
|
||||
activeNavs = activeNavs.concat(topNavs);
|
||||
});
|
||||
return <NavControllerBase[]> activeNavs;
|
||||
}
|
||||
|
||||
getRootNav(): any {
|
||||
console.warn('(getRootNav) is deprecated and will be removed in the next major release. Use getRootNavById instead.');
|
||||
const rootNavs = this.getRootNavs();
|
||||
if (rootNavs.length === 0) {
|
||||
return null;
|
||||
} else if (rootNavs.length > 1) {
|
||||
console.warn('(getRootNav) there are multiple root navs, use getRootNavs instead');
|
||||
}
|
||||
return rootNavs[0];
|
||||
}
|
||||
|
||||
getRootNavs(): any[] {
|
||||
const navs: NavigationContainer[] = [];
|
||||
this._rootNavs.forEach(nav => navs.push(nav));
|
||||
return navs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {NavController} Returns the root NavController
|
||||
*/
|
||||
getRootNav(): NavController {
|
||||
return this._rootNav;
|
||||
getRootNavById(navId: string): NavigationContainer {
|
||||
return this._rootNavs.get(navId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
_setRootNav(nav: any) {
|
||||
this._rootNav = nav;
|
||||
registerRootNav(nav: NavigationContainer) {
|
||||
this._rootNavs.set(nav.id, nav);
|
||||
}
|
||||
|
||||
|
||||
getActiveNavContainers(): NavigationContainer[] {
|
||||
// for each root nav container, get it's active nav
|
||||
let list: NavigationContainer[] = [];
|
||||
this._rootNavs.forEach((container: NavigationContainer) => {
|
||||
list = list.concat(findTopNavs(container));
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +321,7 @@ export class App {
|
||||
}
|
||||
|
||||
const navPromise = this.navPop();
|
||||
if (navPromise === null) {
|
||||
if (!navPromise) {
|
||||
// no views to go back to
|
||||
// let's exit the app
|
||||
if (this._config.getBoolean('navExitApp', true)) {
|
||||
@@ -281,7 +336,7 @@ export class App {
|
||||
* @hidden
|
||||
*/
|
||||
navPop(): Promise<any> {
|
||||
if (!this._rootNav || !this.isEnabled()) {
|
||||
if (!this._rootNavs || this._rootNavs.size === 0 || !this.isEnabled()) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -290,9 +345,23 @@ export class App {
|
||||
if (portal.length() > 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
// next get the active nav, check itself and climb up all
|
||||
// of its parent navs until it finds a nav that can pop
|
||||
return recursivePop(this.getActiveNav());
|
||||
|
||||
let navToPop: NavControllerBase = null;
|
||||
let mostRecentVC: ViewController = null;
|
||||
this._rootNavs.forEach((navContainer: NavigationContainer) => {
|
||||
const activeNavs = this.getActiveNavs(navContainer.id);
|
||||
const poppableNavs = activeNavs.map(activeNav => getPoppableNav(activeNav)).filter(nav => !!nav);
|
||||
poppableNavs.forEach(poppable => {
|
||||
const topViewController = poppable.last();
|
||||
if (poppable._isPortal || (topViewController && poppable.length() > 1 && (!mostRecentVC || topViewController._ts >= mostRecentVC._ts))) {
|
||||
mostRecentVC = topViewController;
|
||||
navToPop = poppable;
|
||||
}
|
||||
});
|
||||
});
|
||||
if (navToPop) {
|
||||
return navToPop.pop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -307,9 +376,10 @@ export class App {
|
||||
platform.registerListener(platform.doc(), 'focusin', onFocusin, { capture: true, zone: false, passive: true });
|
||||
platform.registerListener(platform.doc(), 'touchend', onTouchend, { capture: false, zone: false, passive: true });
|
||||
|
||||
function onFocusin(ev: any) {
|
||||
function onFocusin() {
|
||||
focused = true;
|
||||
}
|
||||
|
||||
function onTouchend(ev: any) {
|
||||
// if app did scroll return early
|
||||
if (self._didScroll) {
|
||||
@@ -351,35 +421,38 @@ export class App {
|
||||
|
||||
}
|
||||
|
||||
function recursivePop(nav: any): Promise<any> {
|
||||
|
||||
function getPoppableNav(nav: NavControllerBase): NavControllerBase {
|
||||
if (!nav) {
|
||||
return null;
|
||||
}
|
||||
if (isNav(nav)) {
|
||||
var len = nav.length();
|
||||
if (len > 1 || (nav._isPortal && len > 0)) {
|
||||
// this nav controller has more than one view
|
||||
// pop the current view on this nav and we're done here
|
||||
console.debug('app, goBack pop nav');
|
||||
return nav.pop();
|
||||
}
|
||||
|
||||
if (isTabs(nav)) {
|
||||
// tabs aren't a nav, so just call this function again immediately on the parent on tabs
|
||||
return getPoppableNav(nav.parent);
|
||||
}
|
||||
const len = nav.length();
|
||||
if (len > 1 || (nav._isPortal && len > 0)) {
|
||||
// this nav controller has more than one view
|
||||
// use this nav!
|
||||
return nav;
|
||||
}
|
||||
// try again using the parent nav (if there is one)
|
||||
return recursivePop(nav.parent);
|
||||
return getPoppableNav(nav.parent);
|
||||
}
|
||||
|
||||
function findTopNav(nav: NavController) {
|
||||
var activeChildNav: any;
|
||||
|
||||
while (nav) {
|
||||
activeChildNav = nav.getActiveChildNav();
|
||||
if (!activeChildNav) {
|
||||
break;
|
||||
}
|
||||
nav = activeChildNav;
|
||||
export function findTopNavs(nav: NavigationContainer): NavigationContainer[] {
|
||||
let containers: NavigationContainer[] = [];
|
||||
const childNavs = nav.getActiveChildNavs();
|
||||
if (!childNavs || !childNavs.length) {
|
||||
containers.push(nav);
|
||||
} else {
|
||||
childNavs.forEach(childNav => {
|
||||
const topNavs = findTopNavs(childNav);
|
||||
containers = containers.concat(topNavs);
|
||||
});
|
||||
}
|
||||
|
||||
return nav;
|
||||
return containers;
|
||||
}
|
||||
|
||||
const SKIP_BLURRING = ['INPUT', 'TEXTAREA', 'ION-INPUT', 'ION-TEXTAREA'];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Directive, ElementRef, forwardRef, Inject, Renderer } from '@angular/core';
|
||||
import { Directive, ElementRef, Inject, Renderer, forwardRef } from '@angular/core';
|
||||
|
||||
import { App } from '../app/app';
|
||||
import { Config } from '../../config/config';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Menu, MenuType } from './menu-interface';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { removeArrayItem, assert } from '../../util/util';
|
||||
import { assert, removeArrayItem } from '../../util/util';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ export interface Menu {
|
||||
getBackdropElement(): HTMLElement;
|
||||
_canOpen(): boolean;
|
||||
persistent: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface MenuType {
|
||||
ani: Animation;
|
||||
@@ -37,4 +37,4 @@ export interface MenuType {
|
||||
setProgessStep(stepValue: number): void;
|
||||
setProgressEnd(shouldComplete: boolean, currentStepValue: number, velocity: number, done: Function): void;
|
||||
destroy(): void;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ComponentFactoryResolver, Directive, ElementRef, ErrorHandler, forwardRef, Inject, Input, NgZone, Optional, Renderer, ViewContainerRef } from '@angular/core';
|
||||
import { ComponentFactoryResolver, Directive, ElementRef, ErrorHandler, Inject, Input, NgZone, Optional, Renderer, ViewContainerRef, forwardRef } from '@angular/core';
|
||||
|
||||
import { App } from './app';
|
||||
import { Config } from '../../config/config';
|
||||
@@ -6,6 +6,7 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { GestureController } from '../../gestures/gesture-controller';
|
||||
import { NavControllerBase } from '../../navigation/nav-controller-base';
|
||||
import { NavigationContainer } from '../../navigation/navigation-container';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { TransitionController } from '../../transitions/transition-controller';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
@@ -16,7 +17,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
@Directive({
|
||||
selector: '[overlay-portal]',
|
||||
})
|
||||
export class OverlayPortal extends NavControllerBase {
|
||||
export class OverlayPortal extends NavControllerBase implements NavigationContainer {
|
||||
constructor(
|
||||
@Inject(forwardRef(() => App)) app: App,
|
||||
config: Config,
|
||||
@@ -55,4 +56,17 @@ export class OverlayPortal extends NavControllerBase {
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
getType() {
|
||||
return 'portal';
|
||||
}
|
||||
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
getSecondaryIdentifier(): string {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { App } from '../app';
|
||||
import { ClickBlock } from '../click-block';
|
||||
import { Config } from '../../../config/config';
|
||||
import { mockApp, mockConfig, mockElementRef, mockNavController, mockPlatform, MockPlatform, mockRenderer, mockTab, mockTabs, mockView, mockViews } from '../../../util/mock-providers';
|
||||
import { MockPlatform, mockApp, mockConfig, mockElementRef, mockNavController, mockPlatform, mockRenderer, mockTab, mockTabs, mockView, mockViews } from '../../../util/mock-providers';
|
||||
import { OverlayPortal } from '../overlay-portal';
|
||||
import { PORTAL_MODAL } from '../app-constants';
|
||||
|
||||
@@ -11,12 +11,12 @@ describe('App', () => {
|
||||
describe('goBack', () => {
|
||||
|
||||
it('should not select the previous tab', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
let tabs = mockTabs();
|
||||
let tab1 = mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
const tabs = mockTabs();
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
|
||||
tab1.root = 'Page1';
|
||||
tab2.root = 'Page2';
|
||||
@@ -44,71 +44,79 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should pop from the active tab, when tabs is nested is the root nav', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
let tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
nav.registerChildNav(tabs);
|
||||
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(tab2, 'pop');
|
||||
spyOn(tab1, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(tab2, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
let view1 = mockView();
|
||||
let view2 = mockView();
|
||||
const view1 = mockView();
|
||||
const view2 = mockView();
|
||||
tab2._views = [view1, view2];
|
||||
tab1._views = [mockView()];
|
||||
|
||||
app.goBack();
|
||||
|
||||
expect(tab1.pop).not.toHaveBeenCalled();
|
||||
expect(tab2.pop).toHaveBeenCalled();
|
||||
expect(portal.pop).not.toHaveBeenCalled();
|
||||
expect(plt.exitApp).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should pop from the active tab, when tabs is the root', () => {
|
||||
let tabs = mockTabs();
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
mockTab(tabs);
|
||||
app._setRootNav(tabs);
|
||||
app.registerRootNav(tabs);
|
||||
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(tab2, 'pop');
|
||||
spyOn(tab1, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(tab2, 'pop').and.returnValue(Promise.resolve());
|
||||
|
||||
let view1 = mockView();
|
||||
let view2 = mockView();
|
||||
const view1 = mockView();
|
||||
const view2 = mockView();
|
||||
tab2._views = [view1, view2];
|
||||
|
||||
app.goBack();
|
||||
|
||||
expect(tab1.pop).not.toHaveBeenCalled();
|
||||
expect(tab2.pop).toHaveBeenCalled();
|
||||
expect(plt.exitApp).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should pop the root nav when nested nav has less than 2 views', () => {
|
||||
let rootNav = mockNavController();
|
||||
let nestedNav = mockNavController();
|
||||
rootNav.registerChildNav(nestedNav);
|
||||
const rootNav = mockNavController();
|
||||
app.registerRootNav(rootNav);
|
||||
|
||||
const nestedNav = mockNavController();
|
||||
nestedNav.parent = rootNav;
|
||||
app._setRootNav(rootNav);
|
||||
rootNav.registerChildNav(nestedNav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(rootNav, 'pop');
|
||||
spyOn(nestedNav, 'pop');
|
||||
spyOn(portal, 'pop');
|
||||
spyOn(rootNav, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(nestedNav, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(portal, 'pop').and.returnValue(Promise.resolve());
|
||||
|
||||
let rootView1 = mockView();
|
||||
let rootView2 = mockView();
|
||||
const rootView1 = mockView();
|
||||
const rootView2 = mockView();
|
||||
mockViews(rootNav, [rootView1, rootView2]);
|
||||
|
||||
let nestedView1 = mockView();
|
||||
const nestedView1 = mockView();
|
||||
mockViews(nestedNav, [nestedView1]);
|
||||
|
||||
app.goBack();
|
||||
@@ -120,22 +128,22 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should pop a view from the nested nav that has more than 1 view', () => {
|
||||
let rootNav = mockNavController();
|
||||
let nestedNav = mockNavController();
|
||||
app._setRootNav(rootNav);
|
||||
const rootNav = mockNavController();
|
||||
const nestedNav = mockNavController();
|
||||
app.registerRootNav(rootNav);
|
||||
rootNav.registerChildNav(nestedNav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(rootNav, 'pop');
|
||||
spyOn(nestedNav, 'pop');
|
||||
spyOn(nestedNav, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
let rootView1 = mockView();
|
||||
let rootView2 = mockView();
|
||||
const rootView1 = mockView();
|
||||
const rootView2 = mockView();
|
||||
mockViews(rootNav, [rootView1, rootView2]);
|
||||
|
||||
let nestedView1 = mockView();
|
||||
let nestedView2 = mockView();
|
||||
const nestedView1 = mockView();
|
||||
const nestedView2 = mockView();
|
||||
mockViews(nestedNav, [nestedView1, nestedView2]);
|
||||
|
||||
app.goBack();
|
||||
@@ -147,18 +155,18 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should pop the overlay in the portal of the root nav', (done: Function) => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop');
|
||||
spyOn(portal, 'pop').and.returnValue(Promise.resolve());
|
||||
|
||||
let view1 = mockView();
|
||||
let view2 = mockView();
|
||||
const view1 = mockView();
|
||||
const view2 = mockView();
|
||||
mockViews(nav, [view1, view2]);
|
||||
|
||||
let overlay1 = mockView();
|
||||
const overlay1 = mockView();
|
||||
mockViews(portal, [overlay1]);
|
||||
|
||||
app.goBack().then(() => {
|
||||
@@ -173,15 +181,15 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should pop the second view in the root nav', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop');
|
||||
spyOn(nav, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
let view1 = mockView();
|
||||
let view2 = mockView();
|
||||
const view1 = mockView();
|
||||
const view2 = mockView();
|
||||
mockViews(nav, [view1, view2]);
|
||||
|
||||
app.goBack();
|
||||
@@ -192,17 +200,17 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should exit app when only one view in the root nav', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop');
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
let view1 = mockView();
|
||||
const view1 = mockView();
|
||||
mockViews(nav, [view1]);
|
||||
|
||||
expect(app.getActiveNav()).toBe(nav);
|
||||
expect(app.getActiveNavs(nav.id)[0]).toBe(nav);
|
||||
expect(nav.first()).toBe(view1);
|
||||
|
||||
app.goBack();
|
||||
@@ -213,8 +221,8 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should not exit app when only one view in the root nav, but navExitApp config set', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop');
|
||||
@@ -222,10 +230,10 @@ describe('App', () => {
|
||||
|
||||
config.set('navExitApp', false);
|
||||
|
||||
let view1 = mockView();
|
||||
const view1 = mockView();
|
||||
mockViews(nav, [view1]);
|
||||
|
||||
expect(app.getActiveNav()).toBe(nav);
|
||||
expect(app.getActiveNavs(nav.id)[0]).toBe(nav);
|
||||
expect(nav.first()).toBe(view1);
|
||||
|
||||
app.goBack();
|
||||
@@ -236,14 +244,14 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should not go back if app is not enabled', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop');
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
let view1 = mockView();
|
||||
const view1 = mockView();
|
||||
mockViews(nav, [view1]);
|
||||
|
||||
app.setEnabled(false, 10000);
|
||||
@@ -263,38 +271,273 @@ describe('App', () => {
|
||||
expect(plt.exitApp).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should first pop the from the nav controller with the most recent view, then pop subsequent views, and eventually exit the app when there isnt anything left to pop', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
const navTwo = mockNavController();
|
||||
app.registerRootNav(navTwo);
|
||||
|
||||
spyOn(plt, 'exitApp');
|
||||
spyOn(nav, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(navTwo, 'pop').and.returnValue(Promise.resolve());
|
||||
spyOn(portal, 'pop');
|
||||
|
||||
const view1 = mockView();
|
||||
const view2 = mockView();
|
||||
mockViews(nav, [view1, view2]);
|
||||
|
||||
const view3 = mockView();
|
||||
view3._ts = view3._ts + 1000;
|
||||
const view4 = mockView();
|
||||
view4._ts = view4._ts + 1000;
|
||||
mockViews(navTwo, [view3, view4]);
|
||||
|
||||
app.goBack();
|
||||
|
||||
mockViews(navTwo, [view3]);
|
||||
|
||||
expect(portal.pop).not.toHaveBeenCalled();
|
||||
expect(nav.pop).not.toHaveBeenCalled();
|
||||
expect(navTwo.pop).toHaveBeenCalled();
|
||||
expect(plt.exitApp).not.toHaveBeenCalled();
|
||||
|
||||
app.goBack();
|
||||
expect(nav.pop).toHaveBeenCalled();
|
||||
|
||||
mockViews(nav, [view1]);
|
||||
|
||||
app.goBack();
|
||||
expect(plt.exitApp).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getActiveNav', () => {
|
||||
describe('getActiveNavs', () => {
|
||||
|
||||
it('should get active NavController when using tabs with nested nav', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
let tabs = mockTabs();
|
||||
let tab1 = mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
const tabs = mockTabs();
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
nav.registerChildNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
let nav2 = mockNavController();
|
||||
let nav3 = mockNavController();
|
||||
let nav4 = mockNavController();
|
||||
const nav2 = mockNavController();
|
||||
nav2.name = 'nav2';
|
||||
const nav3 = mockNavController();
|
||||
nav3.name = 'nav3';
|
||||
const nav4 = mockNavController();
|
||||
nav4.name = 'nav4';
|
||||
|
||||
tab1.registerChildNav(nav4);
|
||||
// tab 2 registers two child navs!!
|
||||
tab2.registerChildNav(nav2);
|
||||
tab2.registerChildNav(nav3);
|
||||
|
||||
expect(app.getActiveNav()).toBe(nav3);
|
||||
const activeNavs = app.getActiveNavs(nav.id);
|
||||
expect(activeNavs.length).toEqual(2);
|
||||
expect(activeNavs[0]).toEqual(nav2);
|
||||
expect(activeNavs[1]).toEqual(nav3);
|
||||
|
||||
const activeNavsTwo = app.getActiveNavs();
|
||||
expect(activeNavsTwo.length).toEqual(2);
|
||||
expect(activeNavsTwo[0]).toEqual(nav2);
|
||||
expect(activeNavsTwo[1]).toEqual(nav3);
|
||||
});
|
||||
|
||||
it('should get active NavController when using tabs, nested in a root nav', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
let tabs = mockTabs();
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
let tab3 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
const tab3 = mockTab(tabs);
|
||||
nav.registerChildNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
|
||||
expect(app.getActiveNavs(nav.id)[0]).toBe(tab2);
|
||||
expect(app.getActiveNavs()[0]).toBe(tab2);
|
||||
|
||||
tab2.setSelected(false);
|
||||
tab3.setSelected(true);
|
||||
expect(app.getActiveNavs(nav.id)[0]).toBe(tab3);
|
||||
expect(app.getActiveNavs()[0]).toBe(tab3);
|
||||
});
|
||||
|
||||
it('should get active tab NavController when using tabs, and tabs is the root', () => {
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
const tab3 = mockTab(tabs);
|
||||
app.registerRootNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
|
||||
expect(app.getActiveNavs(tabs.id)[0]).toBe(tab2);
|
||||
expect(app.getActiveNavs()[0]).toBe(tab2);
|
||||
|
||||
tab2.setSelected(false);
|
||||
tab3.setSelected(true);
|
||||
expect(app.getActiveNavs(tabs.id)[0]).toBe(tab3);
|
||||
expect(app.getActiveNavs()[0]).toBe(tab3);
|
||||
});
|
||||
|
||||
it('should get active NavController when nested 3 deep', () => {
|
||||
const nav1 = mockNavController();
|
||||
const nav2 = mockNavController();
|
||||
const nav3 = mockNavController();
|
||||
app.registerRootNav(nav1);
|
||||
|
||||
nav1.registerChildNav(nav2);
|
||||
nav2.registerChildNav(nav3);
|
||||
|
||||
expect(app.getActiveNavs(nav1.id)[0]).toBe(nav3);
|
||||
expect(app.getActiveNavs()[0]).toBe(nav3);
|
||||
expect(app.getActiveNavs().length).toBe(1);
|
||||
});
|
||||
|
||||
it('should get active NavController when nested 2 deep', () => {
|
||||
const nav1 = mockNavController();
|
||||
const nav2 = mockNavController();
|
||||
app.registerRootNav(nav1);
|
||||
|
||||
nav1.registerChildNav(nav2);
|
||||
|
||||
const activeNav = app.getActiveNavs(nav1.id)[0];
|
||||
|
||||
expect(activeNav).toBe(nav2);
|
||||
|
||||
expect(app.getActiveNavs()[0]).toBe(nav2);
|
||||
});
|
||||
|
||||
it('should get active NavController when only one nav controller', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
expect(app.getActiveNavs(nav.id)[0]).toBe(nav);
|
||||
expect(app.getActiveNavs()[0]).toBe(nav);
|
||||
});
|
||||
|
||||
it('should set/get the root nav controller', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
expect(app.getRootNavById(nav.id)).toBe(nav);
|
||||
});
|
||||
|
||||
it('should not get an active NavController if there is not root set', () => {
|
||||
const activeNavs = app.getActiveNavs();
|
||||
const rootNav = app.getRootNavById('');
|
||||
expect(activeNavs.length).toEqual(0);
|
||||
expect(rootNav).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should just work when there are multiple active navs', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
const rootNavTwo = mockNavController();
|
||||
|
||||
app.registerRootNav(rootNavOne);
|
||||
app.registerRootNav(rootNavTwo);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
const childNavTwo = mockNavController();
|
||||
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
rootNavTwo.registerChildNav(childNavTwo);
|
||||
|
||||
const activeNavOne = app.getActiveNavs(rootNavOne.id)[0];
|
||||
const activeNavTwo = app.getActiveNavs(rootNavTwo.id)[0];
|
||||
|
||||
expect(activeNavOne).toBe(childNavOne);
|
||||
expect(activeNavTwo).toBe(childNavTwo);
|
||||
|
||||
expect(app.getActiveNavs()[0]).toBe(childNavOne);
|
||||
expect(app.getActiveNavs()[1]).toBe(childNavTwo);
|
||||
});
|
||||
|
||||
it('should get the active nav when no id is provided assuming there is one nav', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
|
||||
const result = app.getActiveNavs()[0];
|
||||
|
||||
expect(result).toEqual(childNavOne);
|
||||
});
|
||||
|
||||
it('should return the all the active navs when there is not an id passed', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
|
||||
const rootNavTwo = mockNavController();
|
||||
app.registerRootNav(rootNavTwo);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
|
||||
const childChildNavOne = mockNavController();
|
||||
childNavOne.registerChildNav(childChildNavOne);
|
||||
|
||||
const childNavTwo = mockNavController();
|
||||
rootNavTwo.registerChildNav(childNavTwo);
|
||||
|
||||
const childChildNavTwo = mockNavController();
|
||||
childNavTwo.registerChildNav(childChildNavTwo);
|
||||
|
||||
const results = app.getActiveNavs();
|
||||
expect(results.length).toEqual(2);
|
||||
expect(results[0]).toEqual(childChildNavOne);
|
||||
expect(results[1]).toEqual(childChildNavTwo);
|
||||
|
||||
const withIdResultsOne = app.getActiveNavs(rootNavOne.id);
|
||||
expect(withIdResultsOne.length).toEqual(1);
|
||||
expect(withIdResultsOne[0]).toEqual(childChildNavOne);
|
||||
|
||||
const withIdResultsTwo = app.getActiveNavs(rootNavTwo.id);
|
||||
expect(withIdResultsTwo.length).toEqual(1);
|
||||
expect(withIdResultsTwo[0]).toEqual(childChildNavTwo);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getActiveNav', () => {
|
||||
it('should get active NavController when using tabs with nested nav', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
const tabs = mockTabs();
|
||||
const tab1 = mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
nav.registerChildNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
const nav2 = mockNavController();
|
||||
nav2.name = 'nav2';
|
||||
const nav3 = mockNavController();
|
||||
nav3.name = 'nav3';
|
||||
const nav4 = mockNavController();
|
||||
nav4.name = 'nav4';
|
||||
|
||||
tab1.registerChildNav(nav4);
|
||||
// tab 2 registers two child navs!!
|
||||
tab2.registerChildNav(nav2);
|
||||
tab2.registerChildNav(nav3);
|
||||
|
||||
const activeNav = app.getActiveNav();
|
||||
expect(activeNav).toEqual(nav2);
|
||||
});
|
||||
|
||||
it('should get active NavController when using tabs, nested in a root nav', () => {
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
const tab3 = mockTab(tabs);
|
||||
nav.registerChildNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
@@ -307,11 +550,11 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should get active tab NavController when using tabs, and tabs is the root', () => {
|
||||
let tabs = mockTabs();
|
||||
const tabs = mockTabs();
|
||||
mockTab(tabs);
|
||||
let tab2 = mockTab(tabs);
|
||||
let tab3 = mockTab(tabs);
|
||||
app._setRootNav(tabs);
|
||||
const tab2 = mockTab(tabs);
|
||||
const tab3 = mockTab(tabs);
|
||||
app.registerRootNav(tabs);
|
||||
|
||||
tab2.setSelected(true);
|
||||
|
||||
@@ -323,10 +566,10 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should get active NavController when nested 3 deep', () => {
|
||||
let nav1 = mockNavController();
|
||||
let nav2 = mockNavController();
|
||||
let nav3 = mockNavController();
|
||||
app._setRootNav(nav1);
|
||||
const nav1 = mockNavController();
|
||||
const nav2 = mockNavController();
|
||||
const nav3 = mockNavController();
|
||||
app.registerRootNav(nav1);
|
||||
|
||||
nav1.registerChildNav(nav2);
|
||||
nav2.registerChildNav(nav3);
|
||||
@@ -335,29 +578,87 @@ describe('App', () => {
|
||||
});
|
||||
|
||||
it('should get active NavController when nested 2 deep', () => {
|
||||
let nav1 = mockNavController();
|
||||
let nav2 = mockNavController();
|
||||
app._setRootNav(nav1);
|
||||
const nav1 = mockNavController();
|
||||
const nav2 = mockNavController();
|
||||
app.registerRootNav(nav1);
|
||||
|
||||
nav1.registerChildNav(nav2);
|
||||
expect(app.getActiveNav()).toBe(nav2);
|
||||
|
||||
const activeNav = app.getActiveNav();
|
||||
|
||||
expect(activeNav).toBe(nav2);
|
||||
});
|
||||
|
||||
it('should get active NavController when only one nav controller', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
const nav = mockNavController();
|
||||
app.registerRootNav(nav);
|
||||
expect(app.getActiveNav()).toBe(nav);
|
||||
});
|
||||
|
||||
it('should set/get the root nav controller', () => {
|
||||
let nav = mockNavController();
|
||||
app._setRootNav(nav);
|
||||
expect(app.getRootNav()).toBe(nav);
|
||||
it('should not get an active NavController if there is not root set', () => {
|
||||
const activeNav = app.getActiveNav();
|
||||
expect(activeNav).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should not get an active NavController if there is not root set', () => {
|
||||
expect(app.getActiveNav()).toBeNull();
|
||||
expect(app.getRootNav()).toBeNull();
|
||||
it('should just work when there are multiple active navs', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
const rootNavTwo = mockNavController();
|
||||
|
||||
app.registerRootNav(rootNavOne);
|
||||
app.registerRootNav(rootNavTwo);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
const childNavTwo = mockNavController();
|
||||
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
rootNavTwo.registerChildNav(childNavTwo);
|
||||
|
||||
const activeNavOne = app.getActiveNav();
|
||||
|
||||
expect(activeNavOne).toBe(childNavOne);
|
||||
});
|
||||
|
||||
it('should get the active nav when no id is provided assuming there is one nav', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
|
||||
const childNavOne = mockNavController();
|
||||
rootNavOne.registerChildNav(childNavOne);
|
||||
|
||||
const result = app.getActiveNav();
|
||||
|
||||
expect(result).toEqual(childNavOne);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getRootNavs', () => {
|
||||
it('should return an array of navs', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
const rootNavTwo = mockNavController();
|
||||
app.registerRootNav(rootNavTwo);
|
||||
|
||||
const results = app.getRootNavs();
|
||||
expect(results.length).toEqual(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getRootNav', () => {
|
||||
it('should return the single root nav', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
const result = app.getRootNav();
|
||||
expect(result).toEqual(rootNavOne);
|
||||
});
|
||||
|
||||
it('should return the first nav in the list for backwards compatibility', () => {
|
||||
const rootNavOne = mockNavController();
|
||||
app.registerRootNav(rootNavOne);
|
||||
const rootNavTwo = mockNavController();
|
||||
app.registerRootNav(rootNavTwo);
|
||||
|
||||
const result = app.getRootNav();
|
||||
expect(result).toEqual(rootNavOne);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -381,7 +682,7 @@ describe('App', () => {
|
||||
|
||||
it('should enable click block when false is passed with duration', () => {
|
||||
// arrange
|
||||
let mockClickBlock: any = {
|
||||
const mockClickBlock: any = {
|
||||
activate: () => {}
|
||||
};
|
||||
|
||||
@@ -398,7 +699,7 @@ describe('App', () => {
|
||||
|
||||
it('should enable click block when false is passed w/o duration', () => {
|
||||
// arrange
|
||||
let mockClickBlock: any = {
|
||||
const mockClickBlock: any = {
|
||||
activate: () => {}
|
||||
};
|
||||
|
||||
@@ -416,7 +717,7 @@ describe('App', () => {
|
||||
|
||||
it('should enable click block when false is passed with a duration of 0 and with a minDuration', () => {
|
||||
// arrange
|
||||
let mockClickBlock: any = {
|
||||
const mockClickBlock: any = {
|
||||
activate: () => {}
|
||||
};
|
||||
|
||||
@@ -433,7 +734,7 @@ describe('App', () => {
|
||||
|
||||
it('should enable click block when false is passed with a null duration and a minDuration', () => {
|
||||
// arrange
|
||||
let mockClickBlock: any = {
|
||||
const mockClickBlock: any = {
|
||||
activate: () => {}
|
||||
};
|
||||
|
||||
@@ -450,7 +751,7 @@ describe('App', () => {
|
||||
|
||||
it('should enable click block when false is passed with a duration and a minDuration', () => {
|
||||
// arrange
|
||||
let mockClickBlock: any = {
|
||||
const mockClickBlock: any = {
|
||||
activate: () => {}
|
||||
};
|
||||
|
||||
@@ -466,10 +767,10 @@ describe('App', () => {
|
||||
});
|
||||
});
|
||||
|
||||
var app: App;
|
||||
var config: Config;
|
||||
var plt: MockPlatform;
|
||||
var portal: OverlayPortal;
|
||||
let app: App;
|
||||
let config: Config;
|
||||
let plt: MockPlatform;
|
||||
let portal: OverlayPortal;
|
||||
|
||||
beforeEach(() => {
|
||||
config = mockConfig();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { Checkbox } from '../checkbox';
|
||||
import { mockConfig, mockElementRef, mockRenderer, mockItem } from '../../../util/mock-providers';
|
||||
import { commonInputTest, BOOLEAN_CORPUS } from '../../../util/input-tester';
|
||||
import { mockConfig, mockElementRef, mockItem, mockRenderer } from '../../../util/mock-providers';
|
||||
import { BOOLEAN_CORPUS, commonInputTest } from '../../../util/input-tester';
|
||||
|
||||
describe('Checkbox', () => {
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ import { DomController } from '../../platform/dom-controller';
|
||||
import { Img } from '../img/img-interface';
|
||||
import { Ion } from '../ion';
|
||||
import { isTabs } from '../../navigation/nav-util';
|
||||
import { isTrueProperty, assert, removeArrayItem } from '../../util/util';
|
||||
import { assert, isTrueProperty, removeArrayItem } from '../../util/util';
|
||||
import { Keyboard } from '../../platform/keyboard';
|
||||
import { NavController } from '../../navigation/nav-controller';
|
||||
import { Content as IContent, Tabs } from '../../navigation/nav-interfaces';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { ScrollView, ScrollEvent } from '../../util/scroll-view';
|
||||
import { ScrollEvent, ScrollView } from '../../util/scroll-view';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
export { ScrollEvent } from '../../util/scroll-view';
|
||||
@@ -63,7 +63,7 @@ export class EventEmitterProxy<T> extends EventEmitter<T> {
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* ### Sroll Events
|
||||
* ### Scroll Events
|
||||
*
|
||||
* Scroll events happen outside of Angular's Zones. This is for performance reasons. So
|
||||
* if you're trying to bind a value to any scroll event, it will need to be wrapped in
|
||||
|
||||
@@ -8,8 +8,23 @@ import { PickerColumn } from '../picker/picker-options';
|
||||
import { Form } from '../../util/form';
|
||||
import { BaseInput } from '../../util/base-input';
|
||||
import { Item } from '../item/item';
|
||||
import { deepCopy, isBlank, isPresent, isArray, isObject, isString, assert, clamp } from '../../util/util';
|
||||
import { dateValueRange, renderDateTime, renderTextFormat, convertDataToISO, convertFormatToKey, getValueFromFormat, parseTemplate, parseDate, updateDate, DateTimeData, daysInMonth, dateSortValue, dateDataSortValue, LocaleData } from '../../util/datetime-util';
|
||||
import { assert, clamp, deepCopy, isArray, isBlank, isObject, isPresent, isString } from '../../util/util';
|
||||
import {
|
||||
DateTimeData,
|
||||
LocaleData,
|
||||
convertDataToISO,
|
||||
convertFormatToKey,
|
||||
dateDataSortValue,
|
||||
dateSortValue,
|
||||
dateValueRange,
|
||||
daysInMonth,
|
||||
getValueFromFormat,
|
||||
parseDate,
|
||||
parseTemplate,
|
||||
renderDateTime,
|
||||
renderTextFormat,
|
||||
updateDate,
|
||||
} from '../../util/datetime-util';
|
||||
|
||||
/**
|
||||
* @name DateTime
|
||||
|
||||
@@ -90,7 +90,7 @@ describe('DateTime', () => {
|
||||
columns[0].selectedIndex = 1; // February
|
||||
datetime.validate();
|
||||
|
||||
for (var i = 0; i < 28; i++) {
|
||||
for (let i = 0; i < 28; i++) {
|
||||
expect(columns[1].options[i].disabled).toEqual(false);
|
||||
}
|
||||
expect(columns[1].options[28].disabled).toEqual(true);
|
||||
@@ -100,7 +100,7 @@ describe('DateTime', () => {
|
||||
columns[0].selectedIndex = 3; // April
|
||||
datetime.validate();
|
||||
|
||||
for (var i = 0; i < 30; i++) {
|
||||
for (let i = 0; i < 30; i++) {
|
||||
expect(columns[1].options[i].disabled).toEqual(false);
|
||||
}
|
||||
expect(columns[1].options[30].disabled).toEqual(true);
|
||||
@@ -130,7 +130,7 @@ describe('DateTime', () => {
|
||||
}
|
||||
|
||||
// // Days
|
||||
for (var i = 0; i < columns[1].options.length; i++) {
|
||||
for (let i = 0; i < columns[1].options.length; i++) {
|
||||
expect(columns[1].options[i].disabled).toEqual(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContentChildren, QueryList, Directive, ElementRef, Renderer } from '@angular/core';
|
||||
import { ContentChildren, Directive, ElementRef, QueryList, Renderer } from '@angular/core';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { isTrueProperty } from '../../util/util';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, ChangeDetectionStrategy, ElementRef, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
@@ -6,4 +6,4 @@ export interface Img {
|
||||
canRequest: boolean;
|
||||
reset(): void;
|
||||
update(): void;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, InfiniteScroll, NavController } from '../../../..';
|
||||
import { InfiniteScroll, IonicApp, IonicModule, NavController } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, InfiniteScroll } from '../../../..';
|
||||
import { InfiniteScroll, IonicApp, IonicModule } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import {
|
||||
Component, ChangeDetectionStrategy, Optional, ElementRef, EventEmitter,
|
||||
Input, Output, Renderer, ViewChild, ViewEncapsulation
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
Input,
|
||||
Optional,
|
||||
Output,
|
||||
Renderer,
|
||||
ViewChild,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { NgControl } from '@angular/forms';
|
||||
|
||||
@@ -14,7 +22,7 @@ import { copyInputAttributes, hasPointerMoved, pointerCoord } from '../../util/
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { Form, IonicFormInput } from '../../util/form';
|
||||
import { BaseInput } from '../../util/base-input';
|
||||
import { isTrueProperty, assert } from '../../util/util';
|
||||
import { assert, isTrueProperty } from '../../util/util';
|
||||
import { Item } from '../item/item';
|
||||
import { Platform } from '../../platform/platform';
|
||||
|
||||
@@ -250,16 +258,16 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
constructor(
|
||||
config: Config,
|
||||
private _plt: Platform,
|
||||
private form: Form,
|
||||
_form: Form,
|
||||
private _app: App,
|
||||
elementRef: ElementRef,
|
||||
renderer: Renderer,
|
||||
@Optional() private _content: Content,
|
||||
@Optional() private item: Item,
|
||||
@Optional() _item: Item,
|
||||
@Optional() public ngControl: NgControl,
|
||||
private _dom: DomController
|
||||
) {
|
||||
super(config, elementRef, renderer, 'input', '', form, item, ngControl);
|
||||
super(config, elementRef, renderer, 'input', '', _form, _item, ngControl);
|
||||
|
||||
this.autocomplete = config.get('autocomplete', 'off');
|
||||
this.autocorrect = config.get('autocorrect', 'off');
|
||||
@@ -267,8 +275,8 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
this._keyboardHeight = config.getNumber('keyboardHeight');
|
||||
this._isTextarea = !!(elementRef.nativeElement.tagName === 'ION-TEXTAREA');
|
||||
|
||||
if (this._isTextarea && item) {
|
||||
item.setElementClass('item-textarea', true);
|
||||
if (this._isTextarea && _item) {
|
||||
_item.setElementClass('item-textarea', true);
|
||||
}
|
||||
// If not inside content, let's disable all the hacks
|
||||
if (!_content) {
|
||||
@@ -450,7 +458,7 @@ export class TextInput extends BaseInput<string> implements IonicFormInput {
|
||||
* Check if we need to clear the text input if clearOnEdit is enabled
|
||||
* @hidden
|
||||
*/
|
||||
checkClearOnEdit(inputValue: string) {
|
||||
checkClearOnEdit(_: string) {
|
||||
if (!this._clearOnEdit) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class RootPage {
|
||||
}
|
||||
}
|
||||
|
||||
submit(ev: UIEvent, value?: any) {
|
||||
submit(_: UIEvent, value?: any) {
|
||||
console.log('Submitted', value);
|
||||
this.submitted = true;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class RootPage {
|
||||
}
|
||||
}
|
||||
|
||||
submit(ev: UIEvent, value: any) {
|
||||
submit(_: UIEvent, value: any) {
|
||||
console.log('Submitted', value);
|
||||
this.submitted = true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getScrollData, TextInput } from '../input';
|
||||
import { TextInput, getScrollData } from '../input';
|
||||
import { ContentDimensions } from '../../content/content';
|
||||
import { mockConfig, mockApp, mockPlatform, mockDomController, mockElementRef, mockElementRefEle, mockRenderer, mockItem, mockForm } from '../../../util/mock-providers';
|
||||
import { commonInputTest, TEXT_CORPUS } from '../../../util/input-tester';
|
||||
import { mockApp, mockConfig, mockDomController, mockElementRef, mockElementRefEle, mockForm, mockItem, mockPlatform, mockRenderer } from '../../../util/mock-providers';
|
||||
import { TEXT_CORPUS, commonInputTest } from '../../../util/input-tester';
|
||||
|
||||
|
||||
function newInput(): TextInput {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ElementRef, Renderer, Input } from '@angular/core';
|
||||
import { ElementRef, Input, Renderer } from '@angular/core';
|
||||
|
||||
import { Config } from '../config/config';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { indexForItem, findReorderItem } from './item-reorder-util';
|
||||
import { findReorderItem, indexForItem } from './item-reorder-util';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { PointerCoordinates, pointerCoord } from '../../util/dom';
|
||||
import { UIEventManager } from '../../gestures/ui-event-manager';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Directive, ElementRef, EventEmitter, Input, NgZone, Renderer, Optional, Output } from '@angular/core';
|
||||
import { Directive, ElementRef, EventEmitter, Input, NgZone, Optional, Output, Renderer } from '@angular/core';
|
||||
|
||||
import { Content } from '../content/content';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { isTrueProperty, reorderArray } from '../../util/util';
|
||||
import { ItemReorderGestureDelegate, ItemReorderGesture } from './item-reorder-gesture';
|
||||
import { ItemReorderGesture, ItemReorderGestureDelegate } from './item-reorder-gesture';
|
||||
import { Platform } from '../../platform/platform';
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ export class ItemReorder implements ItemReorderGestureDelegate {
|
||||
/********* DOM WRITE ********* */
|
||||
let transform = this._plt.Css.transform;
|
||||
if (toIndex >= lastToIndex) {
|
||||
for (var i = lastToIndex; i <= toIndex; i++) {
|
||||
for (let i = lastToIndex; i <= toIndex; i++) {
|
||||
if (i !== fromIndex) {
|
||||
(<any>children[i]).style[transform] = (i > fromIndex)
|
||||
? `translateY(${-itemHeight}px)` : '';
|
||||
@@ -287,7 +287,7 @@ export class ItemReorder implements ItemReorderGestureDelegate {
|
||||
}
|
||||
|
||||
if (toIndex <= lastToIndex) {
|
||||
for (var i = toIndex; i <= lastToIndex; i++) {
|
||||
for (let i = toIndex; i <= lastToIndex; i++) {
|
||||
if (i !== fromIndex) {
|
||||
(<any>children[i]).style[transform] = (i < fromIndex)
|
||||
? `translateY(${itemHeight}px)` : '';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ItemSliding } from './item-sliding';
|
||||
import { List } from '../list/list';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { GestureController, GESTURE_PRIORITY_SLIDING_ITEM, GESTURE_ITEM_SWIPE } from '../../gestures/gesture-controller';
|
||||
import { GESTURE_ITEM_SWIPE, GESTURE_PRIORITY_SLIDING_ITEM, GestureController } from '../../gestures/gesture-controller';
|
||||
import { PanGesture } from '../../gestures/pan-gesture';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { pointerCoord } from '../../util/dom';
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
import { ChangeDetectionStrategy, Component, ContentChildren, ContentChild, ElementRef, EventEmitter, forwardRef, Optional, Output, QueryList, Renderer, ViewEncapsulation, NgZone } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
ContentChild,
|
||||
ContentChildren,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
NgZone,
|
||||
Optional,
|
||||
Output,
|
||||
QueryList,
|
||||
Renderer,
|
||||
ViewEncapsulation,
|
||||
forwardRef } from '@angular/core';
|
||||
|
||||
import { swipeShouldReset, assert } from '../../util/util';
|
||||
import { assert, swipeShouldReset } from '../../util/util';
|
||||
import { Item } from './item';
|
||||
import { List } from '../list/list';
|
||||
import { Platform } from '../../platform/platform';
|
||||
@@ -266,11 +279,11 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
if (openAmount > this._optsWidthRightSide) {
|
||||
var optsWidth = this._optsWidthRightSide;
|
||||
const optsWidth = this._optsWidthRightSide;
|
||||
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
||||
|
||||
} else if (openAmount < -this._optsWidthLeftSide) {
|
||||
var optsWidth = -this._optsWidthLeftSide;
|
||||
const optsWidth = -this._optsWidthLeftSide;
|
||||
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
||||
}
|
||||
|
||||
@@ -296,8 +309,8 @@ export class ItemSliding {
|
||||
restingPoint = 0;
|
||||
}
|
||||
|
||||
this._setOpenAmount(restingPoint, true);
|
||||
this.fireSwipeEvent();
|
||||
this._setOpenAmount(restingPoint, true);
|
||||
return restingPoint;
|
||||
}
|
||||
|
||||
@@ -354,7 +367,7 @@ export class ItemSliding {
|
||||
this._setState(state);
|
||||
|
||||
} else if (openAmount < 0) {
|
||||
var state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
|
||||
const state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
|
||||
? SlidingState.Left | SlidingState.SwipeLeft
|
||||
: SlidingState.Left;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef, QueryList, Renderer, Optional, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef, Optional, QueryList, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { Button } from '../button/button';
|
||||
import { Config } from '../../config/config';
|
||||
|
||||
@@ -22,7 +22,7 @@ export class SessionList {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const data = [
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
</button>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>DateTime</ion-label>
|
||||
<ion-label floating>DateTime</ion-label>
|
||||
<ion-datetime [(ngModel)]="datetime" min="1994-03-14" max="2017-12-09" displayFormat="MM/DD/YYYY" required [disabled]='disabled'></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Select</ion-label>
|
||||
<ion-label floating>Select</ion-label>
|
||||
<ion-select [(ngModel)]="select" [disabled]='strDisabled()'>
|
||||
<ion-option value="">No Game Console</ion-option>
|
||||
<ion-option value="nes">NES</ion-option>
|
||||
<ion-option value="n64">Nintendo64</ion-option>
|
||||
<ion-option value="ps">PlayStation</ion-option>
|
||||
@@ -42,7 +43,7 @@
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Input (text)</ion-label>
|
||||
<ion-label floating>Input (text)</ion-label>
|
||||
<ion-input [(ngModel)]="text" [disabled]='disabled'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { AlertController, List, ItemSliding, ToastController } from '../../../../../../';
|
||||
import { AlertController, ItemSliding, List, ToastController } from '../../../../../../';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'root-page.html'
|
||||
@@ -52,7 +52,7 @@ export class RootPage {
|
||||
console.log('UNREAD', item);
|
||||
}
|
||||
|
||||
didClick(item: ItemSliding) {
|
||||
didClick(_: ItemSliding) {
|
||||
console.log('Clicked, ion-item');
|
||||
|
||||
let alert = this.alertCtrl.create({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Attribute, Directive, ElementRef, Renderer, Input } from '@angular/core';
|
||||
import { Attribute, Directive, ElementRef, Input, Renderer } from '@angular/core';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { Component, ElementRef, HostListener, Renderer, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { Config } from '../../config/config';
|
||||
import { GestureController, BlockerDelegate, BLOCK_ALL } from '../../gestures/gesture-controller';
|
||||
import { isDefined, isUndefined, assert } from '../../util/util';
|
||||
import { BLOCK_ALL, BlockerDelegate, GestureController } from '../../gestures/gesture-controller';
|
||||
import { assert, isDefined, isUndefined } from '../../util/util';
|
||||
import { KEY_ESCAPE } from '../../platform/key';
|
||||
import { LoadingOptions } from './loading-options';
|
||||
import { NavParams } from '../../navigation/nav-params';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
/**
|
||||
@@ -37,8 +36,7 @@ export class LoadingCmp {
|
||||
constructor(
|
||||
private _viewCtrl: ViewController,
|
||||
private _config: Config,
|
||||
private _plt: Platform,
|
||||
private _elementRef: ElementRef,
|
||||
_elementRef: ElementRef,
|
||||
gestureCtrl: GestureController,
|
||||
params: NavParams,
|
||||
renderer: Renderer
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isPresent } from '../../util/util';
|
||||
import { PORTAL_LOADING } from '../app/app-constants';
|
||||
import { LoadingCmp } from './loading-component';
|
||||
import { LoadingOptions } from './loading-options';
|
||||
import { LoadingPopIn, LoadingPopOut, LoadingMdPopIn, LoadingMdPopOut, LoadingWpPopIn, LoadingWpPopOut } from './loading-transitions';
|
||||
import { LoadingMdPopIn, LoadingMdPopOut, LoadingPopIn, LoadingPopOut, LoadingWpPopIn, LoadingWpPopOut } from './loading-transitions';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ export class AppComponent {
|
||||
root = PageOne;
|
||||
|
||||
constructor(app: App) {
|
||||
app.viewDidLeave.subscribe((ev: any) => {
|
||||
app.viewDidLeave.subscribe((_: any) => {
|
||||
console.log('App didLeave');
|
||||
});
|
||||
|
||||
app.viewWillLeave.subscribe((ev: any) => {
|
||||
app.viewWillLeave.subscribe((_: any) => {
|
||||
console.log('App willLeave');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Menu } from './menu';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { GestureController, GESTURE_PRIORITY_MENU_SWIPE, GESTURE_MENU_SWIPE } from '../../gestures/gesture-controller';
|
||||
import { GESTURE_MENU_SWIPE, GESTURE_PRIORITY_MENU_SWIPE, GestureController } from '../../gestures/gesture-controller';
|
||||
import { Platform } from '../../platform/platform';
|
||||
import { SlideEdgeGesture } from '../../gestures/slide-edge-gesture';
|
||||
import { SlideData } from '../../gestures/slide-gesture';
|
||||
@@ -46,7 +46,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
||||
}
|
||||
|
||||
// Set CSS, then wait one frame for it to apply before sliding starts
|
||||
onSlideBeforeStart(ev: any) {
|
||||
onSlideBeforeStart() {
|
||||
console.debug('menu gesture, onSlideBeforeStart', this.menu.side);
|
||||
this.menu._swipeBeforeStart();
|
||||
}
|
||||
@@ -56,14 +56,14 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
||||
this.menu._swipeStart();
|
||||
}
|
||||
|
||||
onSlide(slide: SlideData, ev: any) {
|
||||
onSlide(slide: SlideData) {
|
||||
const z = (this.menu.isRightSide !== this.plt.isRTL ? slide.min : slide.max);
|
||||
const stepValue = (slide.distance / z);
|
||||
|
||||
this.menu._swipeProgress(stepValue);
|
||||
}
|
||||
|
||||
onSlideEnd(slide: SlideData, ev: any) {
|
||||
onSlideEnd(slide: SlideData) {
|
||||
let z = (this.menu.isRightSide !== this.plt.isRTL ? slide.min : slide.max);
|
||||
const currentStepValue = (slide.distance / z);
|
||||
const velocity = slide.velocity;
|
||||
@@ -87,7 +87,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
||||
this.menu._swipeEnd(shouldCompleteLeft, shouldCompleteRight, currentStepValue, velocity);
|
||||
}
|
||||
|
||||
getElementStartPos(slide: SlideData, ev: any) {
|
||||
getElementStartPos(slide: SlideData) {
|
||||
const menu = this.menu;
|
||||
if (menu.isRightSide !== this.plt.isRTL) {
|
||||
return menu.isOpen ? slide.min : slide.max;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Directive, Input, HostListener, Optional } from '@angular/core';
|
||||
import { Directive, HostListener, Input, Optional } from '@angular/core';
|
||||
|
||||
import { Button } from '../button/button';
|
||||
import { MenuController } from '../app/menu-controller';
|
||||
@@ -111,7 +111,7 @@ export class MenuToggle {
|
||||
private _menu: MenuController,
|
||||
@Optional() private _viewCtrl: ViewController,
|
||||
@Optional() private _button: Button,
|
||||
@Optional() private _navbar: Navbar
|
||||
@Optional() _navbar: Navbar
|
||||
) {
|
||||
this._isButton = !!_button;
|
||||
this._inNavbar = !!_navbar;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { OnInit, OnDestroy, ChangeDetectionStrategy, Component, ContentChild, ElementRef, EventEmitter, forwardRef, Input, Output, Renderer, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, Renderer, ViewChild, ViewEncapsulation, forwardRef } from '@angular/core';
|
||||
|
||||
import { App } from '../app/app';
|
||||
import { Backdrop } from '../backdrop/backdrop';
|
||||
import { Config } from '../../config/config';
|
||||
import { Content } from '../content/content';
|
||||
import { DomController } from '../../platform/dom-controller';
|
||||
import { GestureController, GESTURE_GO_BACK_SWIPE, BlockerDelegate } from '../../gestures/gesture-controller';
|
||||
import { isTrueProperty, Side, isRightSide, assert } from '../../util/util';
|
||||
import { BlockerDelegate, GESTURE_GO_BACK_SWIPE, GestureController, } from '../../gestures/gesture-controller';
|
||||
import { Side, assert, isRightSide, isTrueProperty } from '../../util/util';
|
||||
import { Keyboard } from '../../platform/keyboard';
|
||||
import { MenuContentGesture } from './menu-gestures';
|
||||
import { Menu as MenuInterface } from '../app/menu-interface';
|
||||
@@ -25,7 +25,7 @@ import { RootNode } from '../split-pane/split-pane';
|
||||
* will be displayed differently based on the mode, however the display type can be changed
|
||||
* to any of the available [menu types](#menu-types). The menu element should be a sibling
|
||||
* to the app's content element. There can be any number of menus attached to the content.
|
||||
* These can be controlled from the templates, or programmatically using the [MenuController](../app/MenuController).
|
||||
* These can be controlled from the templates, or programmatically using the [MenuController](../../app/MenuController).
|
||||
*
|
||||
* @usage
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, App, MenuController, Nav } from '../../../..';
|
||||
import { App, IonicApp, IonicModule, MenuController, Nav } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, Nav, AlertController } from '../../../..';
|
||||
import { AlertController, IonicApp, IonicModule, Nav } from '../../../..';
|
||||
|
||||
|
||||
@Component({templateUrl: 'page1.html'})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, Nav, AlertController } from '../../../..';
|
||||
import { AlertController, IonicApp, IonicModule, Nav } from '../../../..';
|
||||
|
||||
|
||||
@Component({templateUrl: 'page1.html'})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { Component, NgModule, ViewChild } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule, Nav } from '../../../..';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { KEY_ESCAPE } from '../../platform/key';
|
||||
import { NavParams } from '../../navigation/nav-params';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
import { GestureController, BlockerDelegate, GESTURE_MENU_SWIPE, GESTURE_GO_BACK_SWIPE } from '../../gestures/gesture-controller';
|
||||
import { BlockerDelegate, GESTURE_GO_BACK_SWIPE, GESTURE_MENU_SWIPE, GestureController } from '../../gestures/gesture-controller';
|
||||
import { ModuleLoader } from '../../util/module-loader';
|
||||
import { assert } from '../../util/util';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isPresent } from '../../util/util';
|
||||
import { PORTAL_MODAL } from '../app/app-constants';
|
||||
import { ModalCmp } from './modal-component';
|
||||
import { ModalOptions } from './modal-options';
|
||||
import { ModalSlideIn, ModalSlideOut, ModalMDSlideIn, ModalMDSlideOut } from './modal-transitions';
|
||||
import { ModalMDSlideIn, ModalMDSlideOut, ModalSlideIn, ModalSlideOut } from './modal-transitions';
|
||||
import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicModule, IonicApp } from '../../../../..';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Config, IonicPage, NavController, ModalController, ToastController, Platform } from '../../../../../..';
|
||||
import { Config, IonicPage, ModalController, NavController, Platform, ToastController } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { App, ActionSheetController, AlertController, IonicPage, ModalController, NavController, ToastController } from '../../../../../..';
|
||||
import { ActionSheetController, AlertController, App, IonicPage, ModalController, NavController, ToastController } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AfterViewInit, Component, ComponentFactoryResolver, ElementRef, ErrorHandler, forwardRef, Input, Optional, NgZone, Renderer, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';
|
||||
import { AfterViewInit, Component, ComponentFactoryResolver, ElementRef, ErrorHandler, Input, NgZone, Optional, Renderer, ViewChild, ViewContainerRef, ViewEncapsulation, forwardRef } from '@angular/core';
|
||||
|
||||
import { App } from '../app/app';
|
||||
import { Config } from '../../config/config';
|
||||
@@ -92,10 +92,10 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
this.parent = viewCtrl.getNav();
|
||||
this.parent.registerChildNav(this);
|
||||
|
||||
} else if (app && !app.getRootNav()) {
|
||||
} else if (app && !app.getRootNavById(this.id)) {
|
||||
// a root nav has not been registered yet with the app
|
||||
// this is the root navcontroller for the entire app
|
||||
app._setRootNav(this);
|
||||
app.registerRootNav(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,25 +110,22 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
ngAfterViewInit() {
|
||||
this._hasInit = true;
|
||||
|
||||
let navSegment = this._linker.initNav(this);
|
||||
if (navSegment && (navSegment.component || navSegment.loadChildren)) {
|
||||
// there is a segment match in the linker
|
||||
return this._linker.initViews(navSegment).then(views => {
|
||||
const segment = this._linker.getSegmentByNavIdOrName(this.id, this.name);
|
||||
|
||||
if (segment && (segment.component || segment.loadChildren)) {
|
||||
return this._linker.initViews(segment).then(views => {
|
||||
this.setPages(views, null, null);
|
||||
});
|
||||
|
||||
} else if (this._root) {
|
||||
// no segment match, so use the root property
|
||||
// no segment match, so use the root property but don't set the url I guess
|
||||
const setUrl = segment ? false : true;
|
||||
return this.push(this._root, this.rootParams, {
|
||||
isNavRoot: (<any>this._app.getRootNav() === this)
|
||||
isNavRoot: (<any>this._app.getRootNavById(this.id) === this),
|
||||
updateUrl: setUrl
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
|
||||
goToRoot(opts: NavOptions) {
|
||||
return this.setRoot(this._root, this.rootParams, opts, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @input {Page} The Page component to load as the root page within this nav.
|
||||
*/
|
||||
@@ -149,6 +146,11 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
*/
|
||||
@Input() rootParams: any;
|
||||
|
||||
/**
|
||||
* @input {string} a unique name for the nav element
|
||||
*/
|
||||
@Input() name: string;
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
@@ -167,4 +169,21 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode, I
|
||||
}
|
||||
}
|
||||
|
||||
goToRoot(opts: NavOptions) {
|
||||
return this.setRoot(this._root, this.rootParams, opts, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
getType() {
|
||||
return 'nav';
|
||||
}
|
||||
|
||||
/*
|
||||
* @private
|
||||
*/
|
||||
getSecondaryIdentifier(): string {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<ion-split-pane>
|
||||
<ion-nav [root]="rootOne"></ion-nav>
|
||||
<ion-nav [root]="rootTwo" main #content></ion-nav>
|
||||
|
||||
</ion-split-pane>
|
||||
`
|
||||
})
|
||||
export class AppComponent {
|
||||
rootOne = 'NestedNavOnePageTwo';
|
||||
rootTwo = 'NestedNavTwoPageTwo';
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../..';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent, { swipeBackEnabled: true, preloadModules: true }),
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NestedNavOnePageOne } from './nested-nav-one-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NestedNavOnePageOne)
|
||||
],
|
||||
declarations: [
|
||||
NestedNavOnePageOne
|
||||
]
|
||||
})
|
||||
export class NestedNavOnePageOneModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-nav [root]="root"></ion-nav>
|
||||
`
|
||||
})
|
||||
export class NestedNavOnePageOne {
|
||||
|
||||
root: string = 'NestedNavOnePageTwo';
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NestedNavOnePageTwo } from './nested-nav-one-page-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NestedNavOnePageTwo)
|
||||
],
|
||||
declarations: [
|
||||
NestedNavOnePageTwo
|
||||
]
|
||||
})
|
||||
export class NestedNavOnePageTwoModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-nav [root]="root"></ion-nav>
|
||||
`
|
||||
})
|
||||
export class NestedNavOnePageTwo {
|
||||
|
||||
root: string = 'NonTabOne';
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NestedNavTwoPageOne } from './nested-nav-two-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NestedNavTwoPageOne)
|
||||
],
|
||||
declarations: [
|
||||
NestedNavTwoPageOne
|
||||
]
|
||||
})
|
||||
export class NestedNavTwoPageOneModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-nav [root]="root"></ion-nav>
|
||||
`
|
||||
})
|
||||
export class NestedNavTwoPageOne {
|
||||
|
||||
root: string = 'NestedNavTwoPageTwo';
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NestedNavTwoPageTwo } from './nested-nav-two-page-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NestedNavTwoPageTwo)
|
||||
],
|
||||
declarations: [
|
||||
NestedNavTwoPageTwo
|
||||
]
|
||||
})
|
||||
export class NestedNavTwoPageTwoModule { }
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-nav [root]="root"></ion-nav>
|
||||
`
|
||||
})
|
||||
export class NestedNavTwoPageTwo {
|
||||
|
||||
root: string = 'NonTabTwo';
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NonTabOne } from './non-tab-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NonTabOne)
|
||||
],
|
||||
declarations: [
|
||||
NonTabOne
|
||||
]
|
||||
})
|
||||
export class NonTabOneModule { }
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Nav One</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Nav 1 Page 1
|
||||
<button ion-button (click)="goToTabs()">Go to Tabs 1</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class NonTabOne {
|
||||
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
goToTabs() {
|
||||
this.nav.push('TabsOnePage');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
import { NonTabTwo } from './non-tab-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(NonTabTwo)
|
||||
],
|
||||
declarations: [
|
||||
NonTabTwo
|
||||
]
|
||||
})
|
||||
export class NonTabTwoModule { }
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../..';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Nav Two</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Nav 2 Page 1
|
||||
<button ion-button (click)="goToTabs()">Go to Tabs 2</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class NonTabTwo {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
goToTabs() {
|
||||
this.nav.push('TabsTwoPage');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabOnePageOne } from './tab-one-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabOnePageOne)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabOnePageOne
|
||||
]
|
||||
})
|
||||
export class TabsOneTabOnePageOneModule { }
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabOnePageOne'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 1 Page 1</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 1 Page 1
|
||||
<button ion-button (click)="nextPage()">Go to Next Page</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabOnePageOne {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
nextPage() {
|
||||
this.nav.push('TabsOneTabOnePageTwo', { userId: '123', name: 'Andy Bernard'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabOnePageThree } from './tab-one-page-three';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabOnePageThree)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabOnePageThree
|
||||
]
|
||||
})
|
||||
export class TabsOneTabOnePageThreeModule { }
|
||||
@@ -0,0 +1,32 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabOnePageThree/paramOne/:paramOne/paramTwo/:paramTwo'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 1 Page 3</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 1 Page 3
|
||||
<div>
|
||||
Param One: {{paramOne}}
|
||||
</div>
|
||||
<div>
|
||||
Name: {{paramTwo}}
|
||||
</div>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabOnePageThree {
|
||||
paramOne: string;
|
||||
paramTwo: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.paramOne = navParams.data.paramOne;
|
||||
this.paramTwo = navParams.data.paramTwo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabOnePageTwo } from './tab-one-page-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabOnePageTwo)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabOnePageTwo
|
||||
]
|
||||
})
|
||||
export class TabsOneTabOnePageTwoModule { }
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabOnePageTwo/userId/:userId/name/:name'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 1 Page 2</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 1 Page 2
|
||||
<div>
|
||||
User ID: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Name: {{name}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNext()">Next</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabOnePageTwo {
|
||||
userId: string;
|
||||
name: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.userId = navParams.data.userId;
|
||||
this.name = navParams.data.name;
|
||||
}
|
||||
|
||||
goToNext() {
|
||||
this.nav.push('TabsOneTabOnePageThree', { paramOne: 'Scranton', paramTwo: 'PA'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabTwoPageOne } from './tab-two-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabTwoPageOne)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabTwoPageOne
|
||||
]
|
||||
})
|
||||
export class TabsOneTabTwoPageOneModule { }
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabTwoPageOne'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 2 Page 1</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 2 Page 1
|
||||
<button ion-button (click)="nextPage()">Go to Next Page</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabTwoPageOne {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
nextPage() {
|
||||
this.nav.push('TabsOneTabTwoPageTwo', { userId: '456', name: 'Stanley Hudson'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabTwoPageThree } from './tab-two-page-three';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabTwoPageThree)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabTwoPageThree
|
||||
]
|
||||
})
|
||||
export class TabsOneTabTwoPageThreeModule { }
|
||||
@@ -0,0 +1,32 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabTwoPageThree/paramOne/:paramOne/paramTwo/:paramTwo'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 2 Page 3</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 2 Page 3
|
||||
<div>
|
||||
Param One: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Param Two: {{name}}
|
||||
</div>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabTwoPageThree {
|
||||
paramOne: string;
|
||||
paramTwo: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.paramOne = navParams.data.paramOne;
|
||||
this.paramTwo = navParams.data.paramTwo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOneTabTwoPageTwo } from './tab-two-page-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOneTabTwoPageTwo)
|
||||
],
|
||||
declarations: [
|
||||
TabsOneTabTwoPageTwo
|
||||
]
|
||||
})
|
||||
export class TabsOneTabTwoPageTwoModule { }
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOneTabTwoPageTwo/userId/:userId/name/:name'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 1 Tab 2 Page 2</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 1 Tab 2 Page 2
|
||||
<div>
|
||||
User ID: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Name: {{name}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNext()">Next</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsOneTabTwoPageTwo {
|
||||
userId: string;
|
||||
name: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.userId = navParams.data.userId;
|
||||
this.name = navParams.data.name;
|
||||
}
|
||||
|
||||
goToNext() {
|
||||
this.nav.push('TabsOneTabTwoPageThree', { paramOne: 'Nashua', paramTwo: 'NH'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsOnePage } from './tabs-one-page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsOnePage)
|
||||
],
|
||||
declarations: [
|
||||
TabsOnePage
|
||||
]
|
||||
})
|
||||
export class TabsOnePageModule { }
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsOnePage'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-tabs>
|
||||
<ion-tab tabIcon="heart" [root]="tabs1Tab1" tabTitle="Heart"></ion-tab>
|
||||
<ion-tab tabIcon="star" [root]="tabs1Tab2" tabTitle="Star"></ion-tab>
|
||||
</ion-tabs>
|
||||
`
|
||||
})
|
||||
export class TabsOnePage {
|
||||
|
||||
tabs1Tab1: string = 'TabsOneTabOnePageOne';
|
||||
tabs1Tab2: string = 'TabsOneTabTwoPageOne';
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsTwoTabOnePageOne } from './tab-one-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsTwoTabOnePageOne)
|
||||
],
|
||||
declarations: [
|
||||
TabsTwoTabOnePageOne
|
||||
]
|
||||
})
|
||||
export class TabsTwoTabOnePageOneModule { }
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsTwoTabOnePageOne'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 2 Tab 1 Page 1</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 2 Tab 1 Page 1
|
||||
<button ion-button (click)="nextPage()">Go to Next Page</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsTwoTabOnePageOne {
|
||||
constructor(public nav: NavController) {
|
||||
}
|
||||
|
||||
nextPage() {
|
||||
this.nav.push('TabsTwoTabOnePageTwo', { userId: '234', name: 'Phillis Vance - Vance Refridgeration'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsTwoTabOnePageThree } from './tab-one-page-three';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsTwoTabOnePageThree)
|
||||
],
|
||||
declarations: [
|
||||
TabsTwoTabOnePageThree
|
||||
]
|
||||
})
|
||||
export class TabsTwoTabOnePageThreeModule { }
|
||||
@@ -0,0 +1,32 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsTwoTabOnePageThree/paramOne/:paramOne/paramTwo/:paramTwo'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 2 Tab 1 Page 3</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 2 Tab 1 Page 3
|
||||
<div>
|
||||
Param One: {{paramOne}}
|
||||
</div>
|
||||
<div>
|
||||
Param Two: {{paramTwo}}
|
||||
</div>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsTwoTabOnePageThree {
|
||||
paramOne: string;
|
||||
paramTwo: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.paramOne = navParams.data.paramOne;
|
||||
this.paramTwo = navParams.data.paramTwo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsTwoTabOnePageTwo } from './tab-one-page-two';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsTwoTabOnePageTwo)
|
||||
],
|
||||
declarations: [
|
||||
TabsTwoTabOnePageTwo
|
||||
]
|
||||
})
|
||||
export class TabsTwoTabOnePageTwoModule { }
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from '../../../../../../..';
|
||||
|
||||
@IonicPage({
|
||||
segment: 'TabsTwoTabOnePageTwo/userId/:userId/name/:name'
|
||||
})
|
||||
@Component({
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<ion-title>Tabs 2 Tab 1 Page 2</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Tabs 2 Tab 1 Page 2
|
||||
<div>
|
||||
User ID: {{userId}}
|
||||
</div>
|
||||
<div>
|
||||
Name: {{name}}
|
||||
</div>
|
||||
<button ion-button (click)="goToNext()">Next</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class TabsTwoTabOnePageTwo {
|
||||
userId: string;
|
||||
name: string;
|
||||
constructor(public nav: NavController, navParams: NavParams) {
|
||||
this.userId = navParams.data.userId;
|
||||
this.name = navParams.data.name;
|
||||
}
|
||||
|
||||
goToNext() {
|
||||
this.nav.push('TabsTwoTabOnePageThree', { paramOne: 'Stamford', paramTwo: 'CT'});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../../..';
|
||||
import { TabsTwoTabTwoPageOne } from './tab-two-page-one';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
IonicPageModule.forChild(TabsTwoTabTwoPageOne)
|
||||
],
|
||||
declarations: [
|
||||
TabsTwoTabTwoPageOne
|
||||
]
|
||||
})
|
||||
export class TabsTwoTabTwoPageOneModule { }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user