Mixin utility for Angular that makes it easier to write min-safe code
Mixin utility for Angular that makes it easier to write min-safe code, and offers other conveniences.
// MyController.jsvar mix = require'ng-mixin';moduleexports = mix$inject: '$scope' 'myService'// constructor logic here// this.$scope and this.myService created automatically$scope$on'someEvent' thissomeHandler;// this will still be the module, not the scope// thanks to automatic binding;
Can also be used like a traditional mixin, merging two or more objects.
// SomeModel.jsvar mix = require'ng-mixin'EventEmitter = require'events'EventEmitterprototype;moduleexports = mixEventEmitter// we now have event emitting thanks to EventEmitter mixinthisemit'someEvent' prop;