Integrate AirBrake into an angular.js application
bower install ng-helper-airbrake --save
Ensure that the dependency entry comes directly after the angular dependency. Are you not sure? Check & modify the bower.json.
angular.module('appApp', [
'ngHelperAirbrake'
]);
Airbrake requires a project id and secret. This can be configured via the application start in the run function as follows:
.run([ '$airbrake', function($airbrake,) {
// configure airbrake
$airbrake.setProject('<<PROJECTID>>', '<<PROJECTSECRET>>', '<<EnvironmentOptional>>');
// configure host (optional step for self hosted environments)
$airbrake.setHost('https://yourdomain.com');
}]);
The Airbrake plugin is not available as long the setProject method is not called. Only when this method is called exception will be catched from the subsystem.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :)