zonejs

EXCEPTION: Error: Uncaught (in promise): Expected 'styles' to be an array of strings

落爺英雄遲暮 提交于 2019-12-12 14:09:22
问题 I'm working on angular2 "2.0.0-rc.1" But zoneJS is giving following error Error: Uncaught (in promise): Expected 'styles' to be an array of strings. at resolvePromise (zone.js:538) at zone.js:515 at ZoneDelegate.invoke (zone.js:323) at Object.NgZoneImpl.inner.inner.fork.onInvoke (eval at <anonymous> (vendor.js:335), <anonymous>:45:41) at ZoneDelegate.invoke (zone.js:322) at Zone.run (zone.js:216) at zone.js:571 at ZoneDelegate.invokeTask (zone.js:356) at Object.NgZoneImpl.inner.inner.fork

How let Angular2 RC1 know about changed DOM

家住魔仙堡 提交于 2019-12-11 07:32:34
问题 This is actually a spin off from here, with a much simpler use case, though. It is about how to let Angular2 know that there are externally added DOM elements containing Angular directives. In this case, I add a new click button whose on-click event is never bound. Imo I thought Zone would automatically detect any changes in the templates of their components, obviously it doesn't. Is anyone able to make that code work without the immense overhead of creating a new component for the button and

How can i overcome 'Error: Zone already loaded' conflicts with Angular?

岁酱吖の 提交于 2019-12-11 04:56:57
问题 I have developed a simple Angular app built using Angular CLI that is designed to be embedded within third party websites. It works fine on a demo site in production mode. However, when the app is included within a website running on Squarespace i get the following error: Uncaught d {__zone_symbol__error: Error: Zone already loaded. at d (https://static1.squarespace.com/static/5804a95d5016e1b3e34d642…} I have ensured that my packaged Angular app script is only being included once. I can only

How can I prevent Firebase from repeatedly triggering change detection in Angular 2?

拟墨画扇 提交于 2019-12-11 02:04:26
问题 Firebase uses a lot of internal asynchronous calls that trigger change detection because of Angular/Zone monkey-patching websockets and setInterval etc. Even when I'm not interacting with my app, I see a cascade of change detection happening all the time, which contributes to slowing things down especially on mobile. This default behavior could be useful, but the way I'm using Firebase right now I have pretty tight control over when I need to update the view, so callbacks from Firebase are

Angular2, ZoneJS and externally changed DOM

做~自己de王妃 提交于 2019-12-10 22:33:51
问题 I need some help concerning an externally changed DOM within an Angular2 RC1 web app. The scenario is simple: I do have a component with an according template that contains an empty div with an ID like this <div id="my-svg-canvas"></div> The typescripted component has an ngOnInit method that triggers a function from a plain JS file that is included via script-tag in the index.html. That function renders an SVG into the above listed "div" tag. The SVG contains some a-elements with on-click

using zone.js hooks in node

和自甴很熟 提交于 2019-12-06 06:08:44
问题 I'm trying to write a simple demo using angular/zone.js in node, but for some reason neither the beforeTask or afterTask are being called. Here is the code I'm running: require('zone.js'); function foo () { Zone.current.fork({ name: 'foo_zone', beforeTask: function () { console.log('~~~ ZONE START ~~~'); }, afterTask: function () { console.log('~~~ ZONE END ~~~'); } }) .run(function () { console.log('in the zone'); console.log('Zone.current.name', Zone.current.name); // prints foo_zone

Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'

﹥>﹥吖頭↗ 提交于 2019-12-05 08:55:24
问题 This is a bad thursday. It is the 13th. And yesterday I explained to my collegues how lucky we were about the 13th falling on a thursday, not on a friday. Well, that was yesterday, and today I woke up with angular's fist in my face: Cannot create property ' creationTrace ' on string '__zone_symbol__optimizedZoneEventTask' Well it might also be zone.js, or maybe even something else deeper down that dark abyss called development stack. Can anybody help me? Sorry for my attitude, it's just that

zone.js violation warnings on console in Angular project only on Chrome

雨燕双飞 提交于 2019-12-04 08:20:30
问题 I've an Angular 4 project created using @angular/cli , when running the application in development mode, I receive those warnings in the console: zone.js:1489 [Violation] 'setTimeout' handler took 209ms 2[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. zone.js:1157 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler

Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'

我的梦境 提交于 2019-12-03 22:12:26
This is a bad thursday. It is the 13th. And yesterday I explained to my collegues how lucky we were about the 13th falling on a thursday, not on a friday. Well, that was yesterday, and today I woke up with angular's fist in my face: Cannot create property ' creationTrace ' on string '__zone_symbol__optimizedZoneEventTask' Well it might also be zone.js, or maybe even something else deeper down that dark abyss called development stack. Can anybody help me? Sorry for my attitude, it's just that working with angular since its early alpha-stages has finally taken its toll on me. PS: Suffice it to

Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 01:14:50
I am using Angular 7 and facing an issue => after login the API GET calls successfully and the component receiving data too, but UI is not displaying that data. When I open the browser console, immediately the data gets populated on the UI and a warning is showing in the console. "core.js:15686 Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?" I have googled this warning and found some workaround like this.ngZone.run() and call my API's inside it. But the issue is, I am using more than 40 components and calling so many API in each component. So I have to call