ng-mixin
1.0.3 • Public • Published ng-mixin
Mixin utility for Angular that makes it easier to write min-safe code, and offers other conveniences.
var mix = require('ng-mixin');
module.exports = mix({
$inject: ['$scope', 'myService'],
init: function ($scope, myService) {
$scope.$on('someEvent', this.someHandler);
},
someHandler: function () {
}
});
Can also be used like a traditional mixin, merging two or more objects.
var mix = require('ng-mixin'),
EventEmitter = require('events').EventEmitter.prototype;
module.exports = mix(EventEmitter, {
someMethod: function () {
this.emit('someEvent', prop)
}
});
Package Sidebar
Install
Weekly Downloads