Skip to content

Commit 29f4a8f

Browse files
committed
Fixes exceptionless#20 - angular integration fails with angular router
@ejsmith I'm thinking that it might be best to remove all of our route logic for 404's and feature usage and have a gist with how to do it.. It would cut down the size.. and keep people from blowing through their plan limits.
1 parent 7a1aa23 commit 29f4a8f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

dist/integrations/angular.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/integrations/angular.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ angular.module('exceptionless', [])
4343
}])
4444
.run(['$rootScope', '$ExceptionlessClient', function($rootScope, $ExceptionlessClient) {
4545
$rootScope.$on('$routeChangeSuccess', function(event, next, current) {
46+
if (!current) {
47+
return;
48+
}
49+
4650
$ExceptionlessClient.createFeatureUsage(current.name)
4751
.setProperty('next', next)
4852
.setProperty('current', current)
@@ -57,7 +61,7 @@ angular.module('exceptionless', [])
5761
});
5862

5963
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
60-
if (toState.name === 'otherwise') {
64+
if (!toState || toState.name === 'otherwise') {
6165
return;
6266
}
6367

@@ -70,6 +74,10 @@ angular.module('exceptionless', [])
7074
});
7175

7276
$rootScope.$on('$stateNotFound', function(event, unfoundState, fromState, fromParams) {
77+
if (!unfoundState) {
78+
return;
79+
}
80+
7381
$ExceptionlessClient.createNotFound(unfoundState.to)
7482
.setProperty('unfoundState', unfoundState)
7583
.setProperty('fromState', fromState)

0 commit comments

Comments
 (0)