zone.js

无法绑定到“ ngModel”,因为它不是“ input”的已知属性

孤者浪人 提交于 2021-02-13 12:05:43
问题: I've got the following error when launching my Angular app, even if the component is not displayed. 即使未显示组件,启动我的Angular应用程序时也会出现以下错误。 I have to comment out the <input> so that my app works. 我必须注释掉 <input> 这样我的应用才能正常工作。 zone.js:461 Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'. (" <div> <label>Created:</label> <input type="text" [ERROR ->][(ngModel)]="test" placeholder="foo" /> </div> </div>"): InterventionDetails@4:28 ; Zone: <root> ; Task: Promise.then ; Value: I'm looking at the Hero plunker, but I don't see any

Purpose of zone.js/dist/zone-patch-rxjs

天涯浪子 提交于 2021-02-07 05:25:07
问题 Probably I am too late with the question but anyway. Could someone explain me in what cases I need to import zone's patch - zone.js/dist/zone-patch-rxjs . As far as I know the patch was added in this PR (successor of this one). I use zone and RxJs in my Angular project and despite seeing make rxjs run in correct zone in PR's description I do not fully understand when it can help me or what problems it should resolve for me. I would appreciate some code examples like before/after. Thanks in

ZoneAwarePromise overwritten when adding Handsontable to Angular-CLI scripts

六眼飞鱼酱① 提交于 2021-01-28 07:06:29
问题 I'd like to add the Handsontable library to my Angular project. Using angular-cli, I added Handsontable to the scripts section of .angular-cli.json : "scripts": [ "../node_modules/handsontable-pro/dist/handsontable.full.js" ] Webpack compiles successfully, however when loading the web application, I'm encountering the following error: VM473:34309 Unhandled promise rejection Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten. Most likely cause is

Unhandled Promise rejection: `(window|global).Promise` has been overwritten

大兔子大兔子 提交于 2021-01-28 05:07:16
问题 My polyfills.ts file contains: import 'core-js/es6'; import 'core-js/es7/reflect'; require('zone.js/dist/zone'); Now I am frequently (but not always) getting thiserror: Unhandled Promise rejection: Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. How can I fix this? 回答1: this issue have been fixed by https://github

Angular Elements / Zone.js event listeners slow down homepage

a 夏天 提交于 2020-05-15 10:37:06
问题 We have an Angular 7 project that generates a Custom Element with Angular Elements. This Custom Element is used in a React project and in an AngularJS project. When the code of the Custom Element is loaded in one of these projects, the site is slowed down by around 30% - even if the Custom Element is not rendered into the DOM! Performance analysis shows that the methods invokeTask() and runTask() from zone.js are called very often. I tried to blacklist the events as it is described in https:/

Karma + Jasmine: Cannot read property 'getComponentFromError'

天大地大妈咪最大 提交于 2019-12-29 07:42:40
问题 I am following this tutorial: https://angular.io/guide/testing#component-test-scenarios for karma+jasmine unit testing. Here my code: import { AppComponent } from "./app.component"; import { ComponentFixture, TestBed } from "@angular/core/testing"; describe('AppComponent', () => { let component: AppComponent; let fixture: ComponentFixture<AppComponent>; let h1: HTMLElement; beforeEach(() => { TestBed.configureTestingModule({ declarations: [ AppComponent ], }); fixture = TestBed

Testing | Cannot read property 'assertPresent' of undefined at resetFakeAsyncZone

被刻印的时光 ゝ 提交于 2019-12-23 13:09:12
问题 I have a problem with karma v1.4. testing framework. All my unit tests are now failing with error Cannot read property 'assertPresent' of undefined at resetFakeAsyncZone I've already searched for solutions and tested them, but unfortunately none helped. The solutions suggests that I should change the order of imports in my test.js file. I've done that. This is the suggested order I am using, but it still fails: import 'zone.js/dist/zone.js'; // 1st import 'zone.js/dist/async-test'; // 2nd

How to stop errors generated by zone.js in browser console?

浪尽此生 提交于 2019-12-23 09:22:14
问题 Here is my code in the httpService.ts public HttpPost(url: string, data: any): Observable<Response> { let headers = new Headers(); let reqOpts = new RequestOptions(); headers.append(AUTH_CONTENT_TYPE_KEY, AUTH_CONTENT_TYPE); if (this.Token) { headers.append(AUTH_HEADER_KEY, AUTH_TOKEN_PREFIX + this.Token); } reqOpts.headers = headers; return this.http.post(url, data, reqOpts).timeout(30000).map((res: Response) => res) .catch((err: Response) => { return Observable.throw(err) }); } If I try to

Angular 4.x + Cordova : FileReader fails silently (white screen of death)

青春壹個敷衍的年華 提交于 2019-12-21 20:54:24
问题 I have an Angular 4.3 + Cordova application that used to work very well. But now, I get a blank screen on app start-up, and nothing happens any more. After digging a while I realized where it comes from : my home page is protected by a CanActivate guard that will check some file-system-persisted preferences and redirect the user to another page if this is the first run or if a required preference is missing, to fill-in the required properties. So the launch of the app depends on my

Due to Zone.js in Angular Universal server rendering stops working. How to fix?

依然范特西╮ 提交于 2019-12-12 02:17:07
问题 When in my requests for data I return simple JSON without connection to database the server rendering in Angular Universal works fine. However I have found that requests to MySQL database is not going if I don't have a proper version of Zone.js. I had the following error: TypeError: Cannot read property 'on' of undefined at Protocol._enqueue (/Applications/MAMP/htdocs/Angular2/myproject/node_modules/mysql/lib/protocol/Protocol.js:152:5) ... Also I payed attention that I had a warning: