"readme":"AngularFire\n===========\nAngularFire is an officially supported [AngularJS](http://angularjs.org/) binding\nfor [Firebase](http://www.firebase.com/?utm_medium=web&utm_source=angularFire).\nFirebase is a full backend so you don't need servers to build your Angular app!\n\nThe bindings let you associate a Firebase URL with a model (or set of models),\nand they will be transparently kept in sync across all clients currently using\nyour app. The 2-way data binding offered by AngularJS works as normal, except\nthat the changes are also sent to all other clients instead of just a server.\n\n### Live Demo: <a target=\"_blank\" href=\"http://firebase.github.io/angularFire/examples/chat/\">Simple chat room</a>.\n### Live Demo: <a target=\"_blank\" href=\"http://firebase.github.io/angularFire/examples/todomvc/\">Real-time TODO app</a>.\n\n[![Build Status](https://travis-ci.org/firebase/angularFire.png)](https://travis-ci.org/firebase/angularFire)\n\nUsage\n-----\nInclude both firebase.js and angularFire.js in your application.\n\n```html\n<script src=\"https://cdn.firebase.com/v0/firebase.js\"></script>\n<script src=\"angularFire.js\"></script>\n```\n\nAdd the module `firebase` as a dependency to your app module:\n\n```js\nvar myapp = angular.module('myapp', ['firebase']);\n```\n\nYou now have two options.\n\nOption 1: Implicit synchronization\n----------------------------------\nThis method is great if you want to implicitly synchronize a model with Firebase.\nAll local changes will be automatically sent to Firebase, and all remote changes\nwill instantly update the local model.\n\nSet `angularFire` as a service dependency in your controller:\n\n```js\nmyapp.controller('MyCtrl', ['$scope', 'angularFire',\n function MyCtrl($scope, angularFire) {\n ...\n }\n]);\n```\n\nBind a Firebase URL to any model in `$scope`. The fourth argument is the type\nof model you want to use (can be any JavaScript type, you mostly want a\ndictionary or array):\n\n```js\nvar url = 'https://<my-firebase>.firebaseio.com/items';\nvar promise = angularFire(url, $scope, 'items', []);\n```\n\nUse the model in your markup as you normally would:\n\n```html\n<ul ng-controller=\"MyCtrl\">\n <li ng-repeat=\"item in items\">{{item.name}}: {{item.desc}}</li>\n</ul>\n```\n\nData from Firebase is loaded asynchronously, so make sure you edit the model\n*only after the promise has been fulfilled*. You can do this using the `then`\nmethod (See the\n[Angular documentation on $q](http://docs.angularjs.org/api/ng.$q)\nfor more on how promises work).\n\nPlace all your logic that will manipulate the model like this:\n\n```js\npromise.then(function() {\n // Add a new item by simply modifying the model directly.\n $scope.items.push({name: \"Firebase\", desc: \"is awesome!\"});\n // Or, attach a function to $scope that will let a directive in markup manipulate the model.\n $scope.removeItem = function() {\n $scope.items.splice($scope.toRemove, 1);\n $scope.toRemove = null;\n };\n});\n```\n\nSee the source for the\n[controller behind the demo TODO app](https://github.com/firebase/angularFire/blob/gh-pages/examples/todomvc/js/controllers/todoCtrl.js)\nfor a working example of this pattern.\n\nOption 2: Explicit synchronization\n---------------------------------- \nThis method is great if you want control over when local changes are\nsynchronized to Firebase. Any changes made to a model won't be synchronized\nautomatically, and you must invoke specific methods if you wish to update the\nremote data. All remote changes will automatically appear in the local model\n(1-way synchronization).\n\nSet `angularFireCollection` as a service dependency in your controller:\n\n```js\nmyapp.controller('MyCtrl', ['$scope', 'angularFireCollection',\n function MyCtrl($scope, angularFireCollection) {\n ...\n }\n]);\n```\n\nCreate a collection at a specified Firebase URL and assign it to a model in `$scope`:\n\n```js\n$scope.items = angularFireCollection(url);\n```\n\nUse the model as you normally would in your markup:\n\n```html\n<ul ng-controller=\"MyCtrl\">\n <li ng-repeat=\"item in items\">{{item.name}}: {{item.desc}}</li>\n</ul>\n```\n\nYou can bind specific functions if you wish to add, remove or update objects in\nthe collection with any Angular directive:\n\n```html\n<form ng-submit=\"items.add(item)\">\n <input type=\"text\" ng-model=\"item.name\" placeholder=\"Name\" required/>\n <input type=\"text\" ng-model=\"item.desc\" placeholder=\"Description\"/>\n</form>\n```\n\nYou can do the same with the `remove` and `update` methods.\n\nSee the source for the\n[controller behind the demo chat app](https://github.com/firebase/angularFire/blob/gh-pages/examples/chat/app.js)\nfor a working example of this pattern.\n\nDevelopment\n-----------\nIf you'd like to hack on AngularFire itself, you'll need\n[UglifyJS](https://github.com/mishoo/UglifyJS2) and\n[CasperJS](https://github.com/n1k0/casperjs):\n\n```bash\nnpm install uglifyjs -g\nbrew install casperjs\n```\n\nA Makefile is included for your convenience:\n\n```bash\n# Run tests\nmake test\n# Minify source\nmake minify\n```\n\nLicense\n-------\n[MIT](http://firebase.mit-license.org).\n",
"readmeFilename":"README.md",
"_id":"angular-fire@0.2.0",
"description":"AngularFire =========== AngularFire is an officially supported [AngularJS](http://angularjs.org/) binding for [Firebase](http://www.firebase.com/?utm_medium=web&utm_source=angularFire). Firebase is a full backend so you don't need servers to build your Angular app!",
a){varc=za(b,a);c>=0&&b.splice(c,1);returna}functionU(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throwError("Can't copy Window or Scope");if(a){if(b===a)throwError("Can't copy equivalent objects or arrays");if(E(b))for(varc=a.length=0;c<b.length;c++)a.push(U(b[c]));else{c=a.$$hashKey;m(a,function(b,c){deletea[c]});for(vardinb)a[d]=U(b[d]);ob(a,c)}}else(a=b)&&(E(b)?a=U(b,[]):na(b)?a=newDate(b.getTime()):L(b)&&(a=U(b,{})));returna}functionhc(b,a){vara=a||{},c;for(cinb)b.hasOwnProperty(c)&&
b)}]);a.unshift("ng");varc=sb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);returnc},d=/^NG_DEFER_BOOTSTRAP!/;if(P&&!d.test(P.name))returnc();P.name=P.name.replace(d,"");Ya.resumeBootstrap=function(b){m(b,function(b){a.push(b)});c()}}functionZa(b,a){a=a||"_";returnb.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function$a(b,a,c){if(!b)throwError("Argument '"+(a||"?")+"' is "+(c||"required"));
returnb}functionqa(b,a,c){c&&E(b)&&(b=b[b.length-1]);$a(H(b),a,"not a function, got "+(b&&typeofb=="object"?b.constructor.name||"Object":typeofb));returnb}functionlc(b){functiona(a,b,e){returna[b]||(a[b]=e())}returna(a(b,"angular",Object),"module",function(){varb={};returnfunction(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);returna(b,d,function(){functiona(c,d,e){returnfunction(){b[e||"push"]([c,d,arguments]);returnk}}if(!e)throwError("No module: "+d);varb=[],c=[],j=a("$injector",
d}).replace(nc,"Moz$1")}functionab(b,a){functionc(){vare;for(varb=[this],c=a,h,f,i,j,k,l;b.length;){h=b.shift();f=0;for(i=h.length;f<i;f++){j=u(h[f]);c?j.triggerHandler("$destroy"):c=!c;k=0;for(e=(l=j.children()).length,j=e;k<j;k++)b.push(ca(l[k]))}}returnd.apply(this,arguments)}vard=ca.fn[b],d=d.$original||d;c.$original=d;ca.fn[b]=c}functionK(b){if(binstanceofK)returnb;if(!(thisinstanceofK)){if(B(b)&&b.charAt(0)!="<")throwError("selectors not implemented");returnnewK(b)}if(B(b)){vara=
returna}functionsb(b){functiona(a){returnfunction(b,c){if(L(b))m(b,nb(a));elsereturna(b,c)}}functionc(a,b){if(H(b)||E(b))b=l.instantiate(b);if(!b.$get)throwError("Provider "+a+" must define $get factory method.");returnk[a+f]=b}functiond(a,b){returnc(a,{$get:b})}functione(a){varb=[];m(a,function(a){if(!j.get(a))if(j.put(a,!0),B(a)){varc=sa(a);b=b.concat(e(c.requires)).concat(c._runBlocks);try{for(vard=c._invokeQueue,c=0,f=d.length;c<f;c++){varg=d[c],h=g[0]=="$injector"?l:l.get(g[0]);
h[g[1]].apply(h,g[2])}}catch(p){throwp.message&&(p.message+=" from "+a),p;}}elseif(H(a))try{b.push(l.invoke(a))}catch(i){throwi.message&&(i.message+=" from "+a),i;}elseif(E(a))try{b.push(l.invoke(a))}catch(o){throwo.message&&(o.message+=" from "+String(a[a.length-1])),o;}elseqa(a,"module")});returnb}functiong(a,b){functionc(d){if(typeofd!=="string")throwError("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===h)throwError("Circular dependency: "+i.join(" <- "));returna[d]}elsetry{returni.unshift(d),
b){vard,e,f,j;if(a)if(b===q)i.cookie=escape(a)+"=;path="+R+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(B(b))d=(i.cookie=escape(a)+"="+escape(b)+";path="+R).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(i.cookie!==$){$=i.cookie;d=$.split("; ");r={};for(f=0;f<d.length;f++)e=d[f],j=e.indexOf("="),j>0&&(a=unescape(e.substring(0,j)),r[a]===q&&(r[a]=unescape(e.substring(j+1))))}returnr}};f.defer=function(a,b){varc;
a.info()});returnb};b.get=function(b){returna[b]};returnb}}functionyc(){this.$get=["$cacheFactory",function(b){returnb("templates")}]}functionDb(b){vara={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ",h=/^\s*(https?|ftp|mailto|file):/;this.directive=functioni(d,e){B(d)?($a(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){vare=[];m(a[d],
C(e,c,n);N(n,a,l);$(d,l)}elsen=p,c.html(l);a.unshift(s);k=J(a,n,d,h);for(o=A(c[0].childNodes,h);i.length;){varr=i.pop(),l=i.pop();t=i.pop();varia=i.pop(),D=n;t!==p&&(D=cb(n),C(l,u(t),D));k(function(){b(o,ia,D,e,r)},ia,D,e,r)}i=null}).error(function(a,b,c,d){throwError("Failed to load template: "+d.url);});returnfunction(a,c,d,e,g){i?(i.push(c),i.push(d),i.push(e),i.push(g)):k(function(){b(o,c,d,e,g)},c,d,e,g)}}functionF(a,b){returnb.priority-a.priority}functionta(a,b,c,d){if(b)throwError("Multiple directives ["+
b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}functiony(a,b){varc=j(b,!0);c&&a.push({priority:0,compile:I(function(a,b){vard=b.parent(),e=d.data("$binding")||[];e.push(c);M(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}functionV(a,b,c,d){vare=j(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=j(c[d],!0));c[d]=q;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,
-1}functiond(){returnp+1<b.length?b.charAt(p+1):!1}functione(a){return"0"<=a&&a<="9"}functiong(a){returna==""||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}functionh(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}functionf(a){returna=="-"||a=="+"||e(a)}functioni(a,c,d){d=d||p;throwError("Lexer Error: "+a+" at column"+(y(c)?"s "+c+"-"+p+" ["+b.substring(c,d)+"]":""+d)+" in expression ["+b+"].");}functionj(){for(vara="",c=p;p<b.length;){varg=z(b.charAt(p));if(g=="."||
continue}else{varm=t+d(),A=Ia[t],N=Ia[m];N?(n.push({index:p,text:m,fn:N}),p+=2):A?(n.push({index:p,text:t,fn:A,json:"[,:".indexOf(x)!=-1&&c("+-")}),p+=1):i("Unexpected next character ",p,p+1)}x=t}returnn}functionNc(b,a,c,d){functione(a,c){throwError("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}functiong(){if(R.length===0)throwError("Unexpected end of expression: "+b);returnR[0]}functionh(a,b,c,d){if(R.length>
0){vare=R[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)returne}return!1}functionf(b,c,d,f){return(b=h(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),R.shift(),b):!1}functioni(a){f(a)||e("is unexpected, expecting ["+a+"]",h())}functionj(a,b){returnfunction(c,d){returna(c,d,b)}}functionk(a,b,c){returnfunction(d,e){returnb(d,e,a,c)}}functionl(){for(vara=[];;)if(R.length>0&&!h("}",")",";","]")&&a.push(w()),!f(";"))returna.length==1?a[0]:function(b,c){for(vard,e=0;e<a.length;e++){varf=
f("<",">","<=",">="))a=k(a,b.fn,t());returna}functionx(){for(vara=m(),b;b=f("*","/","%");)a=k(a,b.fn,m());returna}functionm(){vara;returnf("+")?A():(a=f("-"))?k(r,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}functionA(){vara;if(f("("))a=w(),i(")");elseif(f("["))a=N();elseif(f("{"))a=J();else{varb=f();(a=b.fn)||e("not a primary expression",b)}for(varc;b=f("(","[",".");)b.text==="("?(a=y(a,c),c=null):b.text==="["?(c=a,a=V(a)):b.text==="."?(c=a,a=u(a)):e("IMPOSSIBLE");returna}functionN(){vara=
[];if(g().text!="]"){doa.push(F());while(f(","))}i("]");returnfunction(b,c){for(vard=[],e=0;e<a.length;e++)d.push(a[e](b,c));returnd}}functionJ(){vara=[];if(g().text!="}"){do{varb=f(),b=b.string||b.text;i(":");varc=F();a.push({key:b,value:c})}while(f(","))}i("}");returnfunction(b,c){for(vard={},e=0;e<a.length;e++){varf=a[e];d[f.key]=f.value(b,c)}returnd}}varr=I(0),$,R=Lc(b,d),F=function(){vara=o(),c,d;return(d=f("="))?(a.assign||e("implies assignment but ["+b.substring(0,d.index)+"] can not be assigned to",
d),g;if(!e)returnq;if((e=e[f])&&e.then){g=e;if(!("$$v"ine))g.$$v=q,g.then(function(a){g.$$v=a});e=e.$$v}returne},{assign:function(c,d,e){returna(c,e)[b(c,e)]=d}})},w=function(){for(vara=F(),b;;)if(b=f("|"))a=k(a,b.fn,n());elsereturna};a?(F=o,y=u=V=w=function(){e("is not valid json",{text:b,index:0})},$=A()):$=l();R.length!==0&&e("is an unexpected token",R[0]);return$}functionMb(b,a,c){for(vara=a.split("."),d=0;a.length>1;d++){vare=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}returnb[a.shift()]=
a);returnb};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){functione(){this.$id=xa();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$listeners={};this.$$isolateBindings={}}functiong(a){if(i.$$phase)throwError(i.$$phase+" already in progress");i.$$phase=a}functionh(a,b){varc=d(a);qa(c,b);returnc}functionf(){}e.prototype={$new:function(a){if(H(a))throwError("API-CHANGE: Use $controller to instantiate controllers.");
h);e.hasEvent("paste")&&a.bind("paste cut",i)}d.$render=function(){a.val(X(d.$viewValue)?"":d.$viewValue)};varj=c.ngPattern,k=function(a,b){returnX(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),q)};j&&(j.match(/^\/(.*)\/$/)?(j=RegExp(j.substr(1,j.length-2)),e=function(a){returnk(j,a)}):e=function(a){varc=b.$eval(j);if(!c||!c.test)throwError("Expected "+j+" to be a RegExp but was "+c);returnk(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){varl=
/^function\s*[^\(]*\(\s*([^\)]*)\)/m,sc=/,/,tc=/^\s*(_?)(\S+?)\1\s*$/,qc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Eb="Non-assignable model expression: ";Db.$inject=["$provide"];varBc=/^(x[\:\-_]|data[\:\-_])/i,Hb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,ac=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,Ic=ac,Ib={http:80,https:443,ftp:21};hb.prototype={$$replace:!1,absUrl:Ha("$$absUrl"),url:function(a,c){if(w(a))returnthis.$$url;vard=ac.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));
d,e){returnd(a,c)<e(a,c)},">":function(a,c,d,e){returnd(a,c)>e(a,c)},"<=":function(a,c,d,e){returnd(a,c)<=e(a,c)},">=":function(a,c,d,e){returnd(a,c)>=e(a,c)},"&&":function(a,c,d,e){returnd(a,c)&&e(a,c)},"||":function(a,c,d,e){returnd(a,c)||e(a,c)},"&":function(a,c,d,e){returnd(a,c)&e(a,c)},"|":function(a,c,d,e){returne(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Mc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Zc=P.XMLHttpRequest||function(){try{returnnewActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{returnnewActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{returnnewActiveXObject("Msxml2.XMLHTTP")}catch(d){}throwError("This browser does not support XMLHttpRequest.");
0,k=e.$eval(i),l={},n=c.startSymbol(),o=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,n+f+"-"+j+o))});e.$watch(function(){varc=parseFloat(e.$eval(f));returnisNaN(c)?"":(cink||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Kd=S({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){returnfunction(a,c,h){varf=h.ngRepeat,h=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),i,j,k;if(!h)throwError("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=
h[1];i=h[2];h=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!h)throwError("'item' in 'item in collection' should be identifier or (key, value) but got '"+f+"'.");j=h[3]||h[1];k=h[2];varl=neweb;a.$watch(function(a){vare,f,h=a.$eval(i),m=c,q=neweb,y,A,u,w,r,v;if(E(h))r=h||[];else{r=[];for(uinh)h.hasOwnProperty(u)&&u.charAt(0)!="$"&&r.push(u);r.sort()}y=r.length-1;e=0;for(f=r.length;e<f;e++){u=h===r?e:r[e];w=h[u];if(v=l.shift(w)){A=v.scope;q.push(w,v);if(e!==v.index)v.index=e,m.after(v.element);
x;)r.pop()[0].element.remove()}vari;if(!(i=s.match(d)))throwError("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+s+"'.");varj=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),n=c(i[2]?i[1]:k),o=c(i[7]),r=[[{element:f,label:""}]];t&&(a(t)(e),t.removeClass("ng-scope"),t.remove());f.html("");f.bind("change",function(){e.$apply(function(){vara,c=o(e)||[],d={},h,i,j,m,s,t;if(p){i=[];m=0;for(t=r.length;m<t;m++){a=r[m];j=1;for(s=a.length;j<s;j++)if((h=