feat(nav): goBack directive

This commit is contained in:
Manu Mtz.-Almeida
2018-03-27 14:54:43 +02:00
parent 49937eb98c
commit 862e5719c6
10 changed files with 154 additions and 88 deletions

View File

@ -15,13 +15,14 @@ export function inputs(instance: any, el: ElementRef, props: string[]) {
});
}
const accept = 'accept', activated = 'activated', allowEmptySelection = 'allowEmptySelection', animated = 'animated', autoBlockAll = 'autoBlockAll', autoHide = 'autoHide', autocapitalize = 'autocapitalize', autocomplete = 'autocomplete', autocorrect = 'autocorrect', autofocus = 'autofocus', base = 'base', buttonType = 'buttonType', cancelButtonText = 'cancelButtonText', cancelText = 'cancelText', checked = 'checked', clearInput = 'clearInput', clearOnEdit = 'clearOnEdit', closeDuration = 'closeDuration', color = 'color', cols = 'cols', component = 'component', contentId = 'contentId', data = 'data', debounce = 'debounce', defaultHref = 'defaultHref', detail = 'detail', direction = 'direction', disableScroll = 'disableScroll', disabled = 'disabled', displayFormat = 'displayFormat', doneText = 'doneText', dualKnobs = 'dualKnobs', duration = 'duration', edge = 'edge', expandable = 'expandable', fill = 'fill', fixed = 'fixed', floating = 'floating', forceOverscroll = 'forceOverscroll', from = 'from', fullscreen = 'fullscreen', gestureName = 'gestureName', gesturePriority = 'gesturePriority', highlight = 'highlight', href = 'href', icon = 'icon', inputmode = 'inputmode', interfaceOptions = 'interfaceOptions', ionBackdropTap = 'ionBackdropTap', ionBlur = 'ionBlur', ionCancel = 'ionCancel', ionChange = 'ionChange', ionClear = 'ionClear', ionClick = 'ionClick', ionClose = 'ionClose', ionDecrease = 'ionDecrease', ionDrag = 'ionDrag', ionFocus = 'ionFocus', ionGestureCaptured = 'ionGestureCaptured', ionGestureEnd = 'ionGestureEnd', ionGestureMove = 'ionGestureMove', ionGestureNotCaptured = 'ionGestureNotCaptured', ionGestureStart = 'ionGestureStart', ionIncrease = 'ionIncrease', ionInfinite = 'ionInfinite', ionInput = 'ionInput', ionInputDidLoad = 'ionInputDidLoad', ionInputDidUnload = 'ionInputDidUnload', ionMenuChange = 'ionMenuChange', ionOpen = 'ionOpen', ionPress = 'ionPress', ionPull = 'ionPull', ionRadioDidLoad = 'ionRadioDidLoad', ionRadioDidUnload = 'ionRadioDidUnload', ionRefresh = 'ionRefresh', ionRouteChanged = 'ionRouteChanged', ionRouteDataChanged = 'ionRouteDataChanged', ionRouteRedirectChanged = 'ionRouteRedirectChanged', ionScroll = 'ionScroll', ionScrollEnd = 'ionScrollEnd', ionScrollStart = 'ionScrollStart', ionSelect = 'ionSelect', ionSelectOptionDidLoad = 'ionSelectOptionDidLoad', ionSelectOptionDidUnload = 'ionSelectOptionDidUnload', ionSlideDidChange = 'ionSlideDidChange', ionSlideDrag = 'ionSlideDrag', ionSlideNextEnd = 'ionSlideNextEnd', ionSlideNextStart = 'ionSlideNextStart', ionSlidePrevEnd = 'ionSlidePrevEnd', ionSlidePrevStart = 'ionSlidePrevStart', ionSlideReachEnd = 'ionSlideReachEnd', ionSlideReachStart = 'ionSlideReachStart', ionSlideTouchEnd = 'ionSlideTouchEnd', ionSlideTouchStart = 'ionSlideTouchStart', ionSlideTransitionEnd = 'ionSlideTransitionEnd', ionSlideTransitionStart = 'ionSlideTransitionStart', ionSlideWillChange = 'ionSlideWillChange', ionSplitPaneVisible = 'ionSplitPaneVisible', ionStart = 'ionStart', ionStyle = 'ionStyle', ionSwipe = 'ionSwipe', ionTabButtonDidLoad = 'ionTabButtonDidLoad', ionTabButtonDidUnload = 'ionTabButtonDidUnload', ionTabbarClick = 'ionTabbarClick', knob = 'knob', labelId = 'labelId', layout = 'layout', loadingSpinner = 'loadingSpinner', loadingText = 'loadingText', max = 'max', maxAngle = 'maxAngle', maxEdgeStart = 'maxEdgeStart', maxlength = 'maxlength', mediaQuery = 'mediaQuery', menu = 'menu', menuId = 'menuId', message = 'message', min = 'min', minlength = 'minlength', mode = 'mode', multiple = 'multiple', name = 'name', okText = 'okText', options = 'options', or = 'or', orientation = 'orientation', pager = 'pager', passive = 'passive', pattern = 'pattern', paused = 'paused', persistent = 'persistent', pickerFormat = 'pickerFormat', pin = 'pin', placeholder = 'placeholder', placement = 'placement', platform = 'platform', position = 'position', pressed = 'pressed', pullMax = 'pullMax', pullMin = 'pullMin', pullingIcon = 'pullingIcon', pullingText = 'pullingText', ratio = 'ratio', readonly = 'readonly', refreshingSpinner = 'refreshingSpinner', refreshingText = 'refreshingText', required = 'required', results = 'results', round = 'round', rows = 'rows', scrollEnabled = 'scrollEnabled', scrollEvents = 'scrollEvents', scrollable = 'scrollable', selected = 'selected', selectedText = 'selectedText', show = 'show', showCancelButton = 'showCancelButton', size = 'size', snapbackDuration = 'snapbackDuration', snaps = 'snaps', spellcheck = 'spellcheck', stacked = 'stacked', step = 'step', stopPropagation = 'stopPropagation', strong = 'strong', subTitle = 'subTitle', swipeEnabled = 'swipeEnabled', tappable = 'tappable', threshold = 'threshold', title = 'title', translucent = 'translucent', type = 'type', url = 'url', useHash = 'useHash', useTapClick = 'useTapClick', val = 'val', value = 'value', visible = 'visible', width = 'width', wrap = 'wrap';
const accept = 'accept', activated = 'activated', allowEmptySelection = 'allowEmptySelection', animated = 'animated', autoBlockAll = 'autoBlockAll', autoHide = 'autoHide', autocapitalize = 'autocapitalize', autocomplete = 'autocomplete', autocorrect = 'autocorrect', autofocus = 'autofocus', base = 'base', buttonType = 'buttonType', cancelButtonText = 'cancelButtonText', cancelText = 'cancelText', checked = 'checked', clearInput = 'clearInput', clearOnEdit = 'clearOnEdit', closeDuration = 'closeDuration', color = 'color', cols = 'cols', component = 'component', contentId = 'contentId', data = 'data', debounce = 'debounce', defaultHref = 'defaultHref', detail = 'detail', direction = 'direction', disableScroll = 'disableScroll', disabled = 'disabled', displayFormat = 'displayFormat', doneText = 'doneText', dualKnobs = 'dualKnobs', duration = 'duration', edge = 'edge', expandable = 'expandable', fill = 'fill', fixed = 'fixed', floating = 'floating', forceOverscroll = 'forceOverscroll', from = 'from', fullscreen = 'fullscreen', gestureName = 'gestureName', gesturePriority = 'gesturePriority', goBack = 'goBack', highlight = 'highlight', href = 'href', icon = 'icon', inputmode = 'inputmode', interfaceOptions = 'interfaceOptions', ionBackdropTap = 'ionBackdropTap', ionBlur = 'ionBlur', ionCancel = 'ionCancel', ionChange = 'ionChange', ionClear = 'ionClear', ionClick = 'ionClick', ionClose = 'ionClose', ionDecrease = 'ionDecrease', ionDrag = 'ionDrag', ionFocus = 'ionFocus', ionGestureCaptured = 'ionGestureCaptured', ionGestureEnd = 'ionGestureEnd', ionGestureMove = 'ionGestureMove', ionGestureNotCaptured = 'ionGestureNotCaptured', ionGestureStart = 'ionGestureStart', ionIncrease = 'ionIncrease', ionInfinite = 'ionInfinite', ionInput = 'ionInput', ionInputDidLoad = 'ionInputDidLoad', ionInputDidUnload = 'ionInputDidUnload', ionMenuChange = 'ionMenuChange', ionOpen = 'ionOpen', ionPress = 'ionPress', ionPull = 'ionPull', ionRadioDidLoad = 'ionRadioDidLoad', ionRadioDidUnload = 'ionRadioDidUnload', ionRefresh = 'ionRefresh', ionRouteChanged = 'ionRouteChanged', ionRouteDataChanged = 'ionRouteDataChanged', ionRouteRedirectChanged = 'ionRouteRedirectChanged', ionScroll = 'ionScroll', ionScrollEnd = 'ionScrollEnd', ionScrollStart = 'ionScrollStart', ionSelect = 'ionSelect', ionSelectOptionDidLoad = 'ionSelectOptionDidLoad', ionSelectOptionDidUnload = 'ionSelectOptionDidUnload', ionSlideDidChange = 'ionSlideDidChange', ionSlideDrag = 'ionSlideDrag', ionSlideNextEnd = 'ionSlideNextEnd', ionSlideNextStart = 'ionSlideNextStart', ionSlidePrevEnd = 'ionSlidePrevEnd', ionSlidePrevStart = 'ionSlidePrevStart', ionSlideReachEnd = 'ionSlideReachEnd', ionSlideReachStart = 'ionSlideReachStart', ionSlideTouchEnd = 'ionSlideTouchEnd', ionSlideTouchStart = 'ionSlideTouchStart', ionSlideTransitionEnd = 'ionSlideTransitionEnd', ionSlideTransitionStart = 'ionSlideTransitionStart', ionSlideWillChange = 'ionSlideWillChange', ionSplitPaneVisible = 'ionSplitPaneVisible', ionStart = 'ionStart', ionStyle = 'ionStyle', ionSwipe = 'ionSwipe', ionTabButtonDidLoad = 'ionTabButtonDidLoad', ionTabButtonDidUnload = 'ionTabButtonDidUnload', ionTabbarClick = 'ionTabbarClick', knob = 'knob', labelId = 'labelId', layout = 'layout', loadingSpinner = 'loadingSpinner', loadingText = 'loadingText', max = 'max', maxAngle = 'maxAngle', maxEdgeStart = 'maxEdgeStart', maxlength = 'maxlength', mediaQuery = 'mediaQuery', menu = 'menu', menuId = 'menuId', message = 'message', min = 'min', minlength = 'minlength', mode = 'mode', multiple = 'multiple', name = 'name', okText = 'okText', options = 'options', or = 'or', orientation = 'orientation', pager = 'pager', passive = 'passive', pattern = 'pattern', paused = 'paused', persistent = 'persistent', pickerFormat = 'pickerFormat', pin = 'pin', placeholder = 'placeholder', placement = 'placement', platform = 'platform', position = 'position', pressed = 'pressed', pullMax = 'pullMax', pullMin = 'pullMin', pullingIcon = 'pullingIcon', pullingText = 'pullingText', ratio = 'ratio', readonly = 'readonly', refreshingSpinner = 'refreshingSpinner', refreshingText = 'refreshingText', required = 'required', results = 'results', round = 'round', rows = 'rows', scrollEnabled = 'scrollEnabled', scrollEvents = 'scrollEvents', scrollable = 'scrollable', selected = 'selected', selectedText = 'selectedText', show = 'show', showCancelButton = 'showCancelButton', size = 'size', snapbackDuration = 'snapbackDuration', snaps = 'snaps', spellcheck = 'spellcheck', stacked = 'stacked', step = 'step', stopPropagation = 'stopPropagation', strong = 'strong', subTitle = 'subTitle', swipeEnabled = 'swipeEnabled', tappable = 'tappable', threshold = 'threshold', title = 'title', translucent = 'translucent', type = 'type', url = 'url', useHash = 'useHash', useTapClick = 'useTapClick', val = 'val', value = 'value', visible = 'visible', width = 'width', wrap = 'wrap';
@NgDirective({ selector: 'ion-anchor' })
export class Anchor {
@NgInput() href: string;
@NgInput() goBack: boolean;
constructor(el: ElementRef) {
inputs(this, el, [href]);
inputs(this, el, [href, goBack]);
}
}
@ -95,10 +96,11 @@ export class Button {
* The color to use from your Sass `$colors` map. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information, see [Theming your App](/docs/theming/theming-your-app).
*/
@NgInput() color: string;
@NgInput() goBack: boolean;
@NgOutput() ionFocus: NgEventEmitter<any>;
@NgOutput() ionBlur: NgEventEmitter<any>;
constructor(el: ElementRef) {
inputs(this, el, [type, href, buttonType, disabled, round, strong, color]);
inputs(this, el, [type, href, buttonType, disabled, round, strong, color, goBack]);
outputs(this, [ionFocus, ionBlur]);
}
}
@ -603,8 +605,9 @@ export class Item {
* Whether or not this item should be tappable. If true, a button tag will be rendered. Defaults to `false`.
*/
@NgInput() tappable: boolean;
@NgInput() goBack: boolean;
constructor(el: ElementRef) {
inputs(this, el, [color, detail, disabled, href, tappable]);
inputs(this, el, [color, detail, disabled, href, tappable, goBack]);
}
}

View File

@ -14,6 +14,8 @@ export { PopoverController } from './providers/popover-controller';
export { ToastController } from './providers/toast-controller';
// navigation
export { GoBack } from './navigation/go-back';
export { NavController } from './navigation/ion-nav-controller';
export { Nav } from './navigation/ion-nav';
export { IonRouterOutlet } from './navigation/ion-router-outlet';
export { Tab } from './navigation/ion-tab';

View File

@ -9,6 +9,8 @@ import { SelectValueAccessor } from './control-value-accessors/select-value-acce
import { TextValueAccessor } from './control-value-accessors/text-value-accessor';
// navigation
import { GoBack } from './navigation/go-back';
import { NavController } from './navigation/ion-nav-controller';
import { Nav } from './navigation/ion-nav';
import { Tab } from './navigation/ion-tab';
import { Tabs } from './navigation/ion-tabs';
@ -219,6 +221,7 @@ import {
Nav,
Tab,
Tabs,
GoBack,
// router
IonRouterOutlet,
@ -327,6 +330,7 @@ import {
BooleanValueAccessor,
Nav,
IonRouterOutlet,
GoBack,
Tab,
Tabs,
NumericValueAccessor,
@ -353,6 +357,7 @@ export class IonicModule {
return {
ngModule: IonicModule,
providers: [
NavController,
AlertController,
ActionSheetController,
Events,

View File

@ -0,0 +1,17 @@
import { Directive, HostListener } from '@angular/core';
import { NavController } from './ion-nav-controller';
@Directive({
selector: '[goBack]',
})
export class GoBack {
constructor(
private navCtrl: NavController,
) {}
@HostListener('click')
onClick() {
this.navCtrl.setGoback();
}
}

View File

@ -0,0 +1,17 @@
import { Injectable } from '@angular/core';
@Injectable()
export class NavController {
private goback = false;
setGoback() {
this.goback = true;
}
consumeGoBack() {
const goback = this.goback;
this.goback = false;
return goback;
}
}

View File

@ -1,5 +1,7 @@
import { Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, ElementRef, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef } from '@angular/core';
import { ActivatedRoute, ChildrenOutletContexts, PRIMARY_OUTLET } from '@angular/router';
import { NavController } from './ion-nav-controller';
import { NavDirection } from '@ionic/core/dist/types/components/nav/nav-util';
@Directive({
selector: 'ion-router-outlet',
@ -17,11 +19,13 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
@Output('deactivate') deactivateEvents = new EventEmitter<any>();
constructor(
private parentContexts: ChildrenOutletContexts, private location: ViewContainerRef,
private resolver: ComponentFactoryResolver,
private elementRef: ElementRef,
@Attribute('name') name: string,
private changeDetector: ChangeDetectorRef) {
private parentContexts: ChildrenOutletContexts, private location: ViewContainerRef,
private resolver: ComponentFactoryResolver,
private elementRef: ElementRef,
@Attribute('name') name: string,
private changeDetector: ChangeDetectorRef,
private navCtrl: NavController
) {
this.name = name || PRIMARY_OUTLET;
parentContexts.onChildOutletCreated(this.name, this as any);
}
@ -126,11 +130,13 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
if (enteringEl) {
enteringEl.classList.add('ion-page', 'hide-page');
const navEl = this.elementRef.nativeElement;
const navEl = this.elementRef.nativeElement as HTMLIonRouterOutletElement;
navEl.appendChild(enteringEl);
await navEl.componentOnReady();
await navEl.commit(enteringEl);
await navEl.commit(enteringEl, {
direction: this.navCtrl.consumeGoBack() ? NavDirection.back : NavDirection.forward
});
if (this.deactivated) {
this.deactivated.destroy();

View File

@ -81,7 +81,7 @@
"@ngtools/webpack": "1.10.2",
"@schematics/angular": "0.3.2",
"@schematics/package-update": "0.3.2",
"ajv": "6.3.0",
"ajv": "6.4.0",
"autoprefixer": "7.2.6",
"cache-loader": "1.2.2",
"chalk": "2.2.2",
@ -107,7 +107,7 @@
"memory-fs": "0.4.1",
"minimatch": "3.0.4",
"node-modules-path": "1.0.1",
"node-sass": "4.7.2",
"node-sass": "4.8.3",
"nopt": "4.0.1",
"opn": "5.1.0",
"portfinder": "1.0.13",
@ -231,9 +231,9 @@
"integrity": "sha512-6HkJ+IZAy1o+EKjw1hBn+/CzkhHolCMXnUBxjHBCdNduCkeAiijFVCmok5lYbTjCX0xNI/rBtJmkFKrotBmWLQ=="
},
"@ionic/core": {
"version": "0.1.5-1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-0.1.5-1.tgz",
"integrity": "sha512-xeEXpX0yGCtnWEZ7M5G/GSALuBsH6+0GPuLEqDQe2Vejeil+mx2tiq5XV0D3TXirepjDEZg2X6SFuTCwDmRcFA==",
"version": "0.1.5-2",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-0.1.5-2.tgz",
"integrity": "sha512-EnFzeFuW21rSd5RlpohMU+S6a4V1Tqe+ts1fFIMu708yBb0e6EXnd8LvU2nxel3f5W/t66aE8rAqhIpl2P0oMw==",
"requires": {
"ionicons": "4.0.0-18"
}
@ -390,14 +390,15 @@
}
},
"ajv": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.3.0.tgz",
"integrity": "sha1-FlCkERTvAFdMrBC4Ay2PTBSBLac=",
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.4.0.tgz",
"integrity": "sha1-06/3jpJ3VJdx2vAWTP9ISCt1T8Y=",
"dev": true,
"requires": {
"fast-deep-equal": "1.1.0",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.3.1"
"json-schema-traverse": "0.3.1",
"uri-js": "3.0.2"
}
},
"ajv-keywords": {
@ -662,7 +663,7 @@
"dev": true,
"requires": {
"browserslist": "2.11.3",
"caniuse-lite": "1.0.30000819",
"caniuse-lite": "1.0.30000820",
"normalize-range": "0.1.2",
"num2fraction": "1.2.2",
"postcss": "6.0.21",
@ -1095,7 +1096,7 @@
"integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==",
"dev": true,
"requires": {
"caniuse-lite": "1.0.30000819",
"caniuse-lite": "1.0.30000820",
"electron-to-chromium": "1.3.40"
}
},
@ -1106,7 +1107,7 @@
"dev": true,
"requires": {
"base64-js": "1.2.3",
"ieee754": "1.1.10",
"ieee754": "1.1.11",
"isarray": "1.0.0"
}
},
@ -1236,9 +1237,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30000819",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000819.tgz",
"integrity": "sha512-9i1d8eiKA6dLvsMrVrXOTP9/1sd9iIv4iC/UbPbIa9iQd9Gcnozi2sQ0d69TiQY9l7Alt7YIWISOBwyGSM6H0Q==",
"version": "1.0.30000820",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000820.tgz",
"integrity": "sha512-E0dpVjnt1XTNmWlGgdiae/tOF0jrJ/s+dOnwk8PLmPdu5uSu8wTLJhhbhcgUWU4aO9Iy5yUMZYxT60JS259sbQ==",
"dev": true
},
"caseless": {
@ -2295,9 +2296,9 @@
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"ejs": {
"version": "2.5.7",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz",
"integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=",
"version": "2.5.8",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.8.tgz",
"integrity": "sha512-QIDZL54fyV8MDcAsO91BMH1ft2qGGaHIJsJIA/+t+7uvXol1dm413fPcUgUb4k8F/9457rx4/KFE4XfDifrQxQ==",
"dev": true
},
"electron-to-chromium": {
@ -4696,9 +4697,9 @@
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"ieee754": {
"version": "1.1.10",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.10.tgz",
"integrity": "sha512-byWFX8OyW/qeVxcY21r6Ncxl0ZYHgnf0cPup2h34eHXrCJbOp7IuqnJ4Q0omfyWl6Z++BTI6bByf31pZt7iRLg==",
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.11.tgz",
"integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==",
"dev": true
},
"iferr": {
@ -5634,7 +5635,7 @@
"integrity": "sha512-NqAFodJdpBUuf1iD+Ij8hQvF0rCFKlO2KaieoQzAPhFgzLCtJnC7Z7x5gQbGNjoe++wOKAtAmwVEIBLqq2Yp1A==",
"dev": true,
"requires": {
"ejs": "2.5.7"
"ejs": "2.5.8"
}
},
"load-json-file": {
@ -6283,9 +6284,9 @@
"dev": true
},
"node-sass": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.7.2.tgz",
"integrity": "sha512-CaV+wLqZ7//Jdom5aUFCpGNoECd7BbNhjuwdsX/LkXBrHl8eb1Wjw4HvWqcFvhr5KuNgAk8i/myf/MQ1YYeroA==",
"version": "4.8.3",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.8.3.tgz",
"integrity": "sha512-tfFWhUsCk/Y19zarDcPo5xpj+IW3qCfOjVdHtYeG6S1CKbQOh1zqylnQK6cV3z9k80yxAnFX9Y+a9+XysDhhfg==",
"dev": true,
"optional": true,
"requires": {
@ -7890,7 +7891,7 @@
"integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
"dev": true,
"requires": {
"ajv": "6.3.0",
"ajv": "6.4.0",
"ajv-keywords": "3.1.0"
}
},
@ -9431,6 +9432,23 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"uri-js": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-3.0.2.tgz",
"integrity": "sha1-+QuFhQf4HepNz7s8TD2/orVX+qo=",
"dev": true,
"requires": {
"punycode": "2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz",
"integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=",
"dev": true
}
}
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
@ -9644,7 +9662,7 @@
"integrity": "sha512-RSlipNQB1u48cq0wH/BNfCu1tD/cJ8ydFIkNYhp9o+3d+8unClkIovpW5qpFPgmL9OE48wfAnlZydXByWP82AA==",
"dev": true,
"requires": {
"chokidar": "2.0.2",
"chokidar": "2.0.3",
"graceful-fs": "4.1.11",
"neo-async": "2.5.0"
},
@ -9712,9 +9730,9 @@
}
},
"chokidar": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz",
"integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
"integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==",
"dev": true,
"requires": {
"anymatch": "2.0.0",
@ -10043,7 +10061,7 @@
"requires": {
"acorn": "5.5.3",
"acorn-dynamic-import": "2.0.2",
"ajv": "6.3.0",
"ajv": "6.4.0",
"ajv-keywords": "3.1.0",
"async": "2.6.0",
"enhanced-resolve": "3.4.1",
@ -10357,7 +10375,7 @@
"ansi-html": "0.0.7",
"array-includes": "3.0.3",
"bonjour": "3.5.0",
"chokidar": "2.0.2",
"chokidar": "2.0.3",
"compression": "1.7.2",
"connect-history-api-fallback": "1.5.0",
"debug": "3.1.0",
@ -10452,9 +10470,9 @@
"dev": true
},
"chokidar": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz",
"integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
"integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==",
"dev": true,
"requires": {
"anymatch": "2.0.0",

View File

@ -13,10 +13,10 @@ import { Location } from '@angular/common';
<ion-content padding>
Page Two
<div>
<ion-button [routerLink]="['/simple-nav/page-three/paramOne/paramTwo']">Go to Page Three</ion-button>
<ion-button routerLink="/simple-nav/page-three/paramOne/paramTwo">Go to Page Three</ion-button>
</div>
<div>
<ion-button [routerLink]="['/simple-nav/page-one']">Go to Page One</ion-button>
<ion-button routerLink="/simple-nav/page-one" goBack>Go to Page One</ion-button>
</div>
</ion-content>
`