diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b790c6..ef0a2ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.14 +### Bug Fixes: +- Implemented missed `info` interceptor. + ## 0.9.13 ### Bug Fixes: - Fix arrow function arguments. diff --git a/lib/angular-hot-loader.js b/lib/angular-hot-loader.js index 08f4917..fea1a9b 100644 --- a/lib/angular-hot-loader.js +++ b/lib/angular-hot-loader.js @@ -7,7 +7,7 @@ let hotAngular; * Angular Hot Loader. * @param {Object} settings - hot loader setiings. */ -var HotAngular = function(settings) { +const HotAngular = function(settings) { const toString = Function.prototype.toString; this.ANGULAR_MODULE; @@ -83,6 +83,7 @@ HotAngular.prototype.decorator = require('./interceptors/decorator'); HotAngular.prototype.directive = require('./interceptors/directive'); HotAngular.prototype.factory = require('./interceptors/factory'); HotAngular.prototype.filter = require('./interceptors/filter'); +HotAngular.prototype.info = require('./interceptors/info'); HotAngular.prototype.module = require('./interceptors/module'); HotAngular.prototype.provider = require('./interceptors/provider'); HotAngular.prototype.run = require('./interceptors/run'); diff --git a/lib/interceptors/constant.js b/lib/interceptors/constant.js index 3f324aa..95f96b9 100644 --- a/lib/interceptors/constant.js +++ b/lib/interceptors/constant.js @@ -1,5 +1,5 @@ module.exports = function(name, constant) { - var exists = !!this.constantCache[name]; + const exists = !!this.constantCache[name]; this.constantCache[name] = constant; diff --git a/lib/interceptors/info.js b/lib/interceptors/info.js new file mode 100644 index 0000000..9daa08b --- /dev/null +++ b/lib/interceptors/info.js @@ -0,0 +1,8 @@ +module.exports = function(info) { + this.logger(`INFO: + ${info}`, 'info'); + + this.ANGULAR_MODULE.info(info); + + return this; +}; diff --git a/lib/interceptors/service.js b/lib/interceptors/service.js index fd3c621..243de65 100644 --- a/lib/interceptors/service.js +++ b/lib/interceptors/service.js @@ -6,7 +6,7 @@ module.exports = function(name, serviceFunction) { this.logger(`SERVICE "${name}": ${serviceFunction}`, 'info'); - var intercept = function($provide) { + const intercept = function($provide) { $provide.decorator(name, function($delegate) { return $delegate; }); diff --git a/lib/interceptors/value.js b/lib/interceptors/value.js index 362e285..be928ad 100644 --- a/lib/interceptors/value.js +++ b/lib/interceptors/value.js @@ -1,5 +1,5 @@ module.exports = function(name, value) { - var exists = !!this.valueCache[name]; + const exists = !!this.valueCache[name]; this.valueCache[name] = value; diff --git a/lib/logger.js b/lib/logger.js index b1aa146..76bb24c 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -1,4 +1,4 @@ -var logger = function(message, level) { +module.exports = function(message, level) { level = level || 'log'; /* eslint-disable */ @@ -9,5 +9,3 @@ var logger = function(message, level) { } /* eslint-enable */ }; - -module.exports = logger;