UNPKG

@spalger/kibana

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

46 lines (37 loc) 1.19 kB
define(function (require) { var _ = require('lodash'); var $ = require('jquery'); var modules = require('ui/modules'); var module = modules.get('kibana/notify'); var errors = require('ui/notify/errors'); var Notifier = require('ui/notify/Notifier'); var rootNotifier = new Notifier(); require('ui/notify/directives'); module.factory('createNotifier', function () { return function (opts) { return new Notifier(opts); }; }); module.factory('Notifier', function () { return Notifier; }); module.run(function ($timeout) { // provide alternate methods for setting timeouts, which will properly trigger digest cycles Notifier.setTimerFns($timeout, $timeout.cancel); }); /** * Global Angular exception handler (NOT JUST UNCAUGHT EXCEPTIONS) */ // modules // .get('exceptionOverride') // .factory('$exceptionHandler', function () { // return function (exception, cause) { // rootNotifier.fatal(exception, cause); // }; // }); window.onerror = function (err, url, line) { rootNotifier.fatal(new Error(err + ' (' + url + ':' + line + ')')); return true; }; return rootNotifier; });