!function(e,t){"function"==typeof define&&define.amd?define(["angular"],t):"object"==typeof exports?module.exports=t(require("angular")):e.scRepeat=t(e.angular)}(this,function(e){function t(t){return{restrict:"EA",scope:!0,controller:"ScRepeatController",controllerAs:"scRepeat",require:"scRepeat",compile:function(o,r){if(!r.scRepeatCollection&&!r.scRepeat)throw new Error("You need to provide a collection.");var n=t(r.scRepeatCollection||r.scRepeat);return{pre:function(t,o,r,c){c.collection=e.copy(n(t));var i=t.$watchCollection(function(){return n(t)},function(t){c.collection=e.copy(t),c.removedProperties.length&&e.forEach(c.removedProperties,function(e){delete c.collection[e]})});t.$on("$destroy",function(){i()})}}}}}function o(){return{restrict:"EA",require:"^scRepeat",priority:601,link:function(e,t,o,r){if(r.collection){if(!o.scItemKey&&!o.scItem)throw new Error("You need to provide a `key`.");r.removeProperty(o.scItemKey||o.scItem)}}}}var r=function(e,t,o){t&&Object.defineProperties(e,t),o&&Object.defineProperties(e.prototype,o)},n=function(){function e(){this.removedProperties=[]}return r(e,null,{removeProperty:{value:function(e){this.collection&&this.removedProperties.push(e)},writable:!0,enumerable:!0,configurable:!0}}),e}();t.$inject=["$parse"];var c=e.module("scRepeat",[]).controller("ScRepeatController",n).directive("scItem",o).directive("scRepeat",t);return c});