wmluke / angular-bugsnag

Angular wrapper for Bugsnag
36 stars 13 forks source link

How can I use Bugsnag in an app that mixes Angular and "vanilla" JS? #6

Closed davetron5000 closed 9 years ago

davetron5000 commented 9 years ago

An app I work on uses Angular somewhat sparingly. Essentially, it is a collection of mini-apps that do no interact, some of which use Angular and some of which don't.

Because angular-bugsnag calls Bugsnag.noConflict(), this makes the global Bugsnag object unavailable outside of an angular app. I think.

self.noConflict = function() {
  window.Bugsnag = old;
  return self;
};

The reason this is a problem is that my app is a Rails app and, via the asset pipeline, all JS is packed together in one file. So, the inclusion of angular-bugsang 'eats up' this reference, meaning that I cannot use Bugsnag outside of angular.

Is there any reason angular-bugsnag is using noConflict()? How would I go about changing that behavior?

wmluke commented 9 years ago

Hi @davetron5000,

I just released version 0.2.0 which made noConflict support optional and disabled by default. So try upgrading, and I think you should be good to go.