From 68804ba91081c190ebba7a03cdc7f87aa370bc95 Mon Sep 17 00:00:00 2001 From: Tine Kondo Date: Tue, 20 Mar 2018 21:11:55 +0100 Subject: [PATCH] feat(demo): update demo app to Angular CLI `1.7.3` --- app/templates/demo/_README.md | 2 +- app/templates/demo/_package.json | 4 ++-- app/templates/demo/src/polyfills.ts | 13 +++++++++++++ app/templates/demo/src/test.ts | 14 +------------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/templates/demo/_README.md b/app/templates/demo/_README.md index 34c020c..8fce6b4 100644 --- a/app/templates/demo/_README.md +++ b/app/templates/demo/_README.md @@ -1,6 +1,6 @@ # <%= projectName %>-demo -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.8. +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3. ## Development server diff --git a/app/templates/demo/_package.json b/app/templates/demo/_package.json index d8aa734..9344160 100644 --- a/app/templates/demo/_package.json +++ b/app/templates/demo/_package.json @@ -23,7 +23,7 @@ "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/router": "^5.2.0", - "@ng-bootstrap/ng-bootstrap": "1.0.0", + "@ng-bootstrap/ng-bootstrap": "1.0.2", "bootstrap": "4.0.0", "core-js": "^2.4.1", "font-awesome": "^4.7.0", @@ -33,7 +33,7 @@ "@angular/platform-server": "^5.2.0" }, "devDependencies": { - "@angular/cli": "1.6.8", + "@angular/cli": "1.7.3", "@angular/compiler-cli": "^5.2.0", "@angular/language-service": "^5.2.0", "@angularclass/hmr": "~2.1.3", diff --git a/app/templates/demo/src/polyfills.ts b/app/templates/demo/src/polyfills.ts index d68672f..af84770 100644 --- a/app/templates/demo/src/polyfills.ts +++ b/app/templates/demo/src/polyfills.ts @@ -52,7 +52,20 @@ import 'core-js/es7/reflect'; **/ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +// (window as any).__Zone_enable_cross_context_check = true; /*************************************************************************************************** * Zone JS is required by default for Angular itself. diff --git a/app/templates/demo/src/test.ts b/app/templates/demo/src/test.ts index cd612ee..1631789 100644 --- a/app/templates/demo/src/test.ts +++ b/app/templates/demo/src/test.ts @@ -1,24 +1,14 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; +import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; -// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. -declare const __karma__: any; declare const require: any; -// Prevent Karma from running prematurely. -__karma__.loaded = function () {}; - // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, @@ -28,5 +18,3 @@ getTestBed().initTestEnvironment( const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); -// Finally, start Karma to run the tests. -__karma__.start();