/** * @name watch-once * @version 2.0.0 * @fileOverview The watchOnce module adds $watchOnce functionality to your $rootScope * * http://www.github.com/kentcdodds/watchOnce * * @license Scope.$watchOnce may be freely distributed under the MIT license. * @copyright (c) 2015 Kent C. Dodds * @author Kent C. Dodds (http://kentcdodds.com) */ (function(n){if(typeof define==="function"&&define.amd){define(["angular"],n)}else if(typeof exports==="object"){module.exports=n(require("angular"))}else{n(angular)}})(function(n){"use strict";var e=n.module("Scope.$watchOnce",[]);e.run(["$rootScope",function(e){var t={$watch:n.isDefined,$watchCollection:n.isDefined,$watchGroup:function(e){return!!e&&!e.some(function(e){return!n.isDefined(e)})}};var r=Object.getPrototypeOf(e);var i=r.$new;r.$new=function f(){var n=i.apply(this,arguments);o(n);return n};o(e);function o(e){if(!e.$watchOnce){n.forEach(["$watch","$watchGroup","$watchCollection"],function(t){if(n.isFunction(e[t])){e[t+"Once"]=u(t)}})}}function u(e){return function r(i,o,u){var f={fn:n.noop};var a=c(o,f,t[e]);f.fn=this[e].apply(this,[i,a,u]);return f.fn}}function c(n,e,t){return function r(i){if(!t(i)){return}n.apply(this,arguments);e.fn()}}}]);return e.name});