{"id":6388,"date":"2014-04-17T01:14:26","date_gmt":"2014-04-17T01:14:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/problem-about-angularfire-collection-of-common-programming-errors\/"},"modified":"2014-04-17T01:14:26","modified_gmt":"2014-04-17T01:14:26","slug":"problem-about-angularfire-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/problem-about-angularfire-collection-of-common-programming-errors\/","title":{"rendered":"problem about angularfire-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/518700582\/picture?type=large\" \/><br \/>\nTom Maton<br \/>\nangularjs firebase angularfire<br \/>\nI&#8217;m trying to add data to existing data within Firebase using AngularFire my data currently looks like this, very simple list of clients:clients&#8211;Firebase UID&#8212;-client: Client1&#8211;Firebase UID&#8212;-client: Client2&#8211;Firebase UID&#8212;-client: Client3But I want to be able to add under the client sections such as team with a list of team members and some of their details. eg&#8211;Firebase UID&#8212;-client: Client1&#8212;&#8212;team: {Bob: {email: address, position: developer}, Peter: {email: address, position: develope<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0439e12eafba101cc706507a6bce46ca?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nD. Hayes<br \/>\njavascript angularjs firebase angularfire<br \/>\nI&#8217;m using AngularFire in a multiplayer game and it sure looks like AngularFire is deleting my objects after the first load of a controller.I&#8217;m using browserify to concatenate my JS files together so all my modules look like CommonJS modules.My controllers are all loaded via ngViews and defined routes. I&#8217;m trying to keep knowledge of what user objects in Firebase look like confined to a user service; hence, all AngularFire invocations for the user object live in the service.Here&#8217;s my HomeControll<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dee0c672d9860b3319a4a87d99ccebc6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarc A. Champlain<br \/>\nangularjs firebase trigger.io angularfire<br \/>\nI have built a really basic CRUD application with AngularJS and Firebase, I&#8217;m running it on Android using Trigger.ioI log the content of the FirebaseCollection, but if I put the phone in Airplane mode, I get the following error and the application crash:D\/AndroidRuntime(19714): Shutting down VM W\/dalvikvm(19714): threadid=1: thread exiting with uncaught exception (group=0x4153e700) E\/AndroidRuntime(19714): FATAL EXCEPTION: main E\/AndroidRuntime(19714): java.lang.NullPointerException E\/AndroidRun<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f8e273b44adf9f3406bd3c947d430d1b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSandeep Reddy<br \/>\nfirebase angularfire<br \/>\n\/\/controller code.var fireurl = &#8216;https:\/\/someuerid.firebaseio.com\/&#8217; var usersref = new Firebase(fireurl); angularFire(usersref.limit(10), $scope, &#8220;userConcalls&#8221;);\/\/view code&lt;li ng-repeat=&#8221;(key, value) in userConcalls&#8221;&gt;key:{{key}} value: {{value}} &lt;\/li&gt;Error Uncaught Error: Firebase.child failed: First argument was an invalid path: &#8220;.priority&#8221;. Paths must be non-empty strings and can&#8217;t contain &#8220;.&#8221;, &#8220;#&#8221;, &#8220;$&#8221;, &#8220;[&#8220;, or &#8220;]&#8221;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4a07c70e3872200935fc765c496de442?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbennewton999<br \/>\njavascript angularjs internet-explorer-8 firebase angularfire<br \/>\nI have an app that is using angular and firebase. It makes a call to my firebase url and does a simple ng-repeat of the 2 items in the object returned.The app works great in every browser except Internet Explorer 8. I tested it in IE 8 often and it was working. Not that I have launched it, sometime in the last few days it began receiving this error. I have made changes in the app over this time, but nothing in my mind that would change the way IE8 would render it.The error in IE8 is simply:SC<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e1e303fbad7f4d7e58b43c82cc05619a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJared Tomaszewski<br \/>\njavascript angularjs firebase angularfire angular-ui-router<br \/>\nI want to dynamically build a template with data from database (Firebase\/angularFire in my case). The way the template will be built depends on the tag property within each object retrieved with angularFire. My first approach:var imgTemplate = function(tag){return &#8216;&lt;&#8216;+tag.tag+&#8217; class=&#8221;{{ tag.classes }}&#8221; src=&#8221;{{ tag.content }}&#8221; alt=&#8221;{{ tag.alt }}&#8221;&gt;&#8217;; }; var txtTemplate = function(tag){return &#8216;&lt;&#8216;+tag.tag+&#8217; class=&#8221;{{ tag.classes }}&#8221;&gt;{{ tag.content }}&lt;\/&#8217;+tag.tag+&#8217;&gt;&#8217;; };This almost<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/67e7bc6a056608137ac6c56f08d8ce62?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\no_tiger<br \/>\nangularjs firebase angularfire<br \/>\nI am looking for a solid way to have the &#8216;current user id&#8217; in all my controllers available. Using: Firebase Simple Login : Email \/ Password AuthenticationMy ida: I need a &#8216;Factory&#8217; wich I can inject into my controllers, to have the &#8216;current user id&#8217; always available. I came up with this code:app.factory(&#8216;User&#8217;, [&#8216;angularFire&#8217;,\/\/Get Current UserIDfunction(angularFire){console.log (&#8216;FACTORY: User&#8217;);var currentUser = {};var ReturnStr = &#8221;;var ref = new Firebase(&#8220;https:\/\/myFIREBASE.firebaseio.com\/<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bf1851fa0d057c933dc365e049092d6c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSwordfish0321<br \/>\nangularjs controller firebase angularfire<br \/>\nI&#8217;m using ng-submit on a form to push data to a Firebase, everything works as expected. What I would like to do is change views at the same time. On the submit button itself I have ng-click set to execute a function using $location. If I place my changeView function in a .controller method I can&#8217;t utilize $location (specifically, it says &#8211; &#8220;Error: &#8216;undefined&#8217; is not an object (evaluating &#8216;$location.path&#8217;)&#8221;). Any help would be super duper.\/\/ This doesn&#8217;t work and throws the error myApp.controller<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/67e7bc6a056608137ac6c56f08d8ce62?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\no_tiger<br \/>\nfirebase angularfire<br \/>\nHow can I read a (Firebase &amp; FirebaseIndex) object?My Ctrl looks like:var url = &#8216;https:\/\/MYFIREBASE.firebaseio.com\/&#8217;; var toDoRef = new Firebase(url); var index = &#8216;podio_covers\/&#8217;+ $routeParams.label_id +&#8217;\/limesurveys\/&#8217;; var master = &#8216;podio_surveys&#8217;;var surveys = new FirebaseIndex(toDoRef.child(index), toDoRef.child(master)) $scope.surveys = angularFireCollection(surveys);console.log ($scope.surveys) looks like:[add: function, remove: function, update: function] 0: angularFireItem$id: &#8220;85524<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e1e303fbad7f4d7e58b43c82cc05619a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJared Tomaszewski<br \/>\njavascript angularjs firebase angularfire<br \/>\nI am trying to reorder (swap) children by their numerical priority. Here&#8217;s my attempt:var swapChildrenByPriority = function(url, child1Priority, child2Priority){var ref = new Firebase(url);var child1, child2;ref.on(&#8216;value&#8217;, function(snap){snap.forEach(function(child){if(child.getPriority() === child1Priority){child1 = child;};if(child.getPriority() === child2Priority){child2 = child;};});});ref.child(child1.name()).setPriority(child2.getPriority());ref.child(child2.name()).setPriority(child1.get<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/42cf980e96657204193f78ef861fbb0d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlandland<br \/>\nangularjs firebase angularfire<br \/>\nNew to angular and firebase. I am running into the error &#8220;TypeError: Cannot call method &#8216;child&#8217; of undefined&#8221; on initial page load. It is undefined because it isn&#8217;t ready yet, but I am unsure of how to handle the situation.Scenario as follows: 1. User logs in 2. Firebase verifies user is logged in 3. User has a friends list of child &#8216;friends&#8217; 4. Code tries to get child &#8216;friends&#8217; before Firebase can verify the userThe code to login$rootScope.userRef = $rootScope.fireRef.child(&#8216;users&#8217;);$rootScope.<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tom Maton angularjs firebase angularfire I&#8217;m trying to add data to existing data within Firebase using AngularFire my data currently looks like this, very simple list of clients:clients&#8211;Firebase UID&#8212;-client: Client1&#8211;Firebase UID&#8212;-client: Client2&#8211;Firebase UID&#8212;-client: Client3But I want to be able to add under the client sections such as team with a list of team members and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6388","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6388"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6388\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}