Comments (11)
+1
from zone.js.
Please provide a reproduction via plnkr.co, jsfiddle, or [jsbin(http://jsbin.com/). This saves me a lot of time. Thanks!
from zone.js.
fixed my link.. sorry guys.
http://plnkr.co/edit/pm5yrJ?p=info
from zone.js.
I have a problem using long-stack-trace-zone.js with angular too. When I use angulars $timeout its not possible to get a stack trace. Using setTimeout works perfectly fine. Same issue using $promise.
http://plnkr.co/edit/OvExnTzRQaSGv45evxHv
from zone.js.
Looking into it. Thanks for the reproductions.
from zone.js.
Any updates on using zone.js in this way with angular 1.4?
from zone.js.
Pretty sure this is because angular's $exceptionHandler
eats uncaught exceptions inside $apply
'd functions/expressions and logs them to the console. This means they will never reach zone.
In my angular 1.x app that I'm using with zone, I'm decorating $exceptionHandler
to rethrow errors.
See https://docs.angularjs.org/api/ng/service/$exceptionHandler
from zone.js.
Thanks! Would you mind sharing an example of how you are doing the decoration?
Sent from my iPhone
On Sep 9, 2015, at 9:12 AM, Matthew Hill <[email protected]mailto:[email protected]> wrote:
Pretty sure this is because angular's $exceptionHandler eats uncaught exceptions inside $apply'd functions/expressions and logs them to the console. This means they will never reach zone.
In my Angular 1.x app that I'm using with zone, I'm decorating $exceptionHandler to rethrow errors.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/29#issuecomment-138959706.
from zone.js.
Sure. Off the top of my head:
module.config(function($provide) {
$provide.decorator('$exceptionHandler', function($exceptionHandler) {
return function(error, cause) {
$exceptionHandler(error, cause);
throw error;
};
});
});
from zone.js.
Thank you sir! :)
Sent from my iPhone
On Sep 9, 2015, at 9:33 AM, Matthew Hill <[email protected]mailto:[email protected]> wrote:
Sure. Off the top of my head:
module.config(function($provide) {
$provide.decorator('$exceptionHandler', function($exceptionHandler) {
return function(error, cause) {
$exceptionHandler(error, cause);
throw error;
};
});
});
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/29#issuecomment-138965024.
from zone.js.
Why hasn't this been addressed? I'm currently using zone.js 0.5.15 (outdated) to be able to use Fetch API instead of $http in my Angular 1.x app but trigger the digest cycle after multiple asynchronous operations. I haven't been successful using the new API, so I would like some guidance.
What I'm doing is the following:
// Zone addon, so it wraps the promise chain in one "zone" and
// executes some arbitrary task (in this case rootScope digest run)
// after the promise chain.
const scopePrototype = $rootScope.constructor.prototype;
const originalApply = scopePrototype.$apply;
const zoneOptions = {
afterTask: function afterTask() {
try {
$rootScope.$digest();
} catch (e) {
$exceptionHandler(e);
throw e;
}
}
};
scopePrototype.$apply = function $applyFn() : void {
// tslint:disable-next-line:no-var-self
const scope = this;
const applyArgs = arguments;
window.zone.fork(zoneOptions).run(() => {
console.log('Running zone');
originalApply.apply(scope, applyArgs);
});
};
from zone.js.
Related Issues (20)
- Suspicious code in promise.ts HOT 1
- Error: ReferenceError: Zone is not defined HOT 12
- phantomjs
- Missing tag for v0.8.27 release HOT 2
- zone.js breaks IndexedDB on Safari via EventTarget monkey patch
- Upgrade this repo and add support to Jasmine 3.3 HOT 11
- Upgrading to karma 3.0.0, failure of test cases HOT 2
- microTask 'Promise.then': can not transition to 'running', expecting state 'scheduled', was 'scheduling'. HOT 3
- Zone long stack traces generates wrong stack trace HOT 1
- Evergreen bundle missing in dist HOT 2
- Provide example for using in plain JavaScript Node.js app HOT 5
- Browser extensions have window.customElements defined as null
- ServiseWorker compatiblitity issues in 0.9.0 HOT 1
- fakeAsync patch for requestAnimationFrame is not passing the timestamp HOT 4
- Illegal invocation using patched XMLHttpRequest HOT 13
- SyntaxError: Unexpected token
- Angular elements in another angular project: ERROR Error: Expected to not be in Angular Zone, but it is! HOT 4
- window.Zone Already Defined by Other Library HOT 8
- HTMLCanvasElement.toBlob() is no longer patched in 0.9.1 HOT 2
- WTF_ISSUE_555 loop garbage collection / unfunctional HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zone.js.