Skip to content

Commit ec20506

Browse files
committed
* Made noConflict support optional and disabled by default
* Added more documentation
1 parent 8c28f69 commit ec20506

5 files changed

Lines changed: 56 additions & 4 deletions

File tree

dist/angular-bugsnag.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@
1212
.config(['$provide', function ($provide) {
1313
$provide.provider({
1414
bugsnag: function () {
15-
_bugsnag = _bugsnag || Bugsnag.noConflict();
15+
_bugsnag = Bugsnag;
1616
var _self = this;
1717
var _beforeNotify;
1818

19+
this.noConflict = function () {
20+
_bugsnag = Bugsnag.noConflict();
21+
return _self;
22+
};
23+
1924
this.apiKey = function (apiKey) {
2025
_bugsnag.apiKey = apiKey;
2126
return _self;

dist/angular-bugsnag.min.js

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

readme.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,42 @@ Load the `angular-bugsnag` module into your app...
2424
angular.module('app', ['angular-bugsnag'])
2525
```
2626

27-
## Example Usage
27+
## `bugsnagProvider` configuration
28+
29+
The `bugsnagProvider` has pretty much the same [configuration](https://github.com/bugsnag/bugsnag-js#configuration) options as `bugsnag`.
30+
31+
The main difference is that `bugsnagProvider` uses chainable setter methods instead of properties.
32+
33+
### `noConflict`
34+
Call `noConflict()` **before** other settings to remove `bugsnag` from `window`.
35+
36+
### `apiKey`
37+
38+
### `releaseStage`
39+
40+
### `notifyReleaseStages`
41+
42+
### `appVersion`
43+
44+
### `user`
45+
46+
### `projectRoot`
47+
48+
### `endpoint`
49+
50+
### `metaData`
51+
52+
### `autoNotify`
53+
54+
### `beforeNotify`
55+
56+
### Example Usage
2857

2958
```javascript
3059
angular.module('demo-app', ['angular-bugsnag'])
3160
.config(['bugsnagProvider', function (bugsnagProvider) {
3261
bugsnagProvider
62+
.noConflict()
3363
.apiKey('[replace me]')
3464
.releaseStage('development')
3565
.user({
@@ -63,5 +93,16 @@ angular.module('demo-app', ['angular-bugsnag'])
6393
}]);
6494
```
6595

96+
## Contributing
97+
98+
PR's are welcome. Just make sure the tests pass.
99+
100+
```bash
101+
$ make
102+
$ gulp test
103+
```
104+
105+
Additionally, use `gulp serve` or `gulp watch` to run the test app.
106+
66107
## License
67108
MIT

src/scripts/angular-bugsnag.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
.config(['$provide', function ($provide) {
88
$provide.provider({
99
bugsnag: function () {
10-
_bugsnag = _bugsnag || Bugsnag.noConflict();
10+
_bugsnag = Bugsnag;
1111
var _self = this;
1212
var _beforeNotify;
1313

14+
this.noConflict = function () {
15+
_bugsnag = Bugsnag.noConflict();
16+
return _self;
17+
};
18+
1419
this.apiKey = function (apiKey) {
1520
_bugsnag.apiKey = apiKey;
1621
return _self;

test/app/scripts/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
angular.module('demo-app', ['angular-bugsnag'])
55
.config(['bugsnagProvider', function (bugsnagProvider) {
66
bugsnagProvider
7+
//.noConflict()
78
.apiKey('[replace me]')
89
.releaseStage('development')
910
.user({

0 commit comments

Comments
 (0)