diff --git a/angular/src/providers/nav-controller.ts b/angular/src/providers/nav-controller.ts index a87826e63d..1ac733b6bb 100644 --- a/angular/src/providers/nav-controller.ts +++ b/angular/src/providers/nav-controller.ts @@ -1,6 +1,7 @@ import { Injectable, Optional } from '@angular/core'; import { Location } from '@angular/common'; import { NavigationExtras, Router, UrlTree } from '@angular/router'; +import { BackButtonEvent } from '@ionic/core'; export const enum NavIntent { Auto, @@ -19,7 +20,11 @@ export class NavController { constructor( private location: Location, @Optional() private router?: Router - ) {} + ) { + window && window.addEventListener('ionBackButton', (ev) => { + (ev as BackButtonEvent).detail.register(0, () => this.goBack()); + }); + } navigateForward(url: string | UrlTree | any[], animated?: boolean, extras?: NavigationExtras) { this.setIntent(NavIntent.Forward, animated); diff --git a/core/package.json b/core/package.json index 21604f65ea..0d566fc941 100644 --- a/core/package.json +++ b/core/package.json @@ -32,6 +32,7 @@ "@stencil/sass": "0.1.0", "@stencil/utils": "latest", "@types/jest": "^23.3.1", + "agadoo": "^1.0.0", "autoprefixer": "^9.0.2", "chromedriver": "^2.38.3", "clean-css-cli": "^4.1.11", @@ -77,8 +78,9 @@ "theme-builder:dev": "sd concurrent \"npm run theme-app-build -- --watch\" \"stencil build --dev --watch\" \"stencil-dev-server\" \"npm run theme-server\" ", "theme-server": "node scripts/theme-builder/server.js", "tsc": "./node_modules/.bin/tsc -p .", - "validate": "npm run lint && npm run test && npm run build", - "validate.ci": "npm run lint && npm run test && npm run build --max-workers 1 --debug" + "test.treeshake": "agadoo dist/collection/index.js", + "validate": "npm run test.treeshake && npm run lint && npm run test && npm run build", + "validate.ci": "npm run test.treeshake && npm run lint && npm run test && npm run build --max-workers 1 --debug" }, "author": "Ionic Team", "license": "MIT",