var component = function(...injections) { let instance = new target(...injections); utils.applyTransformations(target, instance, injections); let exposed = utils.getFinalComponent(target, instance); return exposed.$expose instanceof Function ? exposed.$expose() : exposed; }
var $delegatefn = function(...injections) { let $inject = target.$inject || ['$delegate']; let delegateIndex = $inject.indexOf('$delegate'); let instance = new target(...injections); utils.applyTransformations(target, instance, injections); let exposed = utils.getFinalComponent(target, instance); return exposed.$decorate instanceof Function ? exposed.$decorate() : injections[delegateIndex]; };
var component = function(...injections) { let instance = new target(...injections); if(!(instance.$filter instanceof Function)) throw Error('an annotated "filter" must implement the "$filter" method'); utils.applyTransformations(target, instance, injections); //@todo remove it in the next version if(instance.$stateful === true) { console.warn('the $stateful property is deprecated and will be removed in the next versions, use the @filter parameter instead'); console.warn('https://github.com/PillowPillow/ng-annotations#d_filter'); filter.$stateful = true; } if(stateful) filter.$stateful = stateful; return filter; function filter(...parameters) { return instance.$filter(...parameters); } }
var component = function(...injections) { let instance = new target(...injections); utils.applyTransformations(target, instance, injections); return utils.getFinalComponent(target, instance); }