angularfire

Get the index ID of an item in Firebase AngularFire

早过忘川 提交于 2020-01-01 00:44:22
问题 A similar question was asked here, but the one accepted answer doesn't really answer the question. Using AngularFire, is it possible to to create relational-style databases? Or access the UniqueIDs? When adding nested items to Firebase via AngularFire, each item is actually set under another index numbered numerically. Because of this, I'll need to reference the user's products with the following relative url: users/:id/products My question is, once I have created a user (or anything for that

How can I add Firebase Storage to my web app?

前提是你 提交于 2019-12-31 04:39:06
问题 I have created a small blog app using angular firebase so that registered user can login and post a blog with article and title. I want to make use of firebase storage so that user can upload images along with the article and title and user can also view the images related to post(store and retrieve feature) in real time. Here is my html : <div flex-xs="100" flex-md="80" layout="row" layout-wrap > <h3 flex="100">Create Post</h3> <md-input-container flex="40" > <label>Title</label> <input ng

Firebase “like” search on string [duplicate]

好久不见. 提交于 2019-12-30 11:54:08
问题 This question already has answers here : How to perform sql “LIKE” operation on firebase? (4 answers) Closed 2 years ago . I am trying to search the user on the basis of name . It search perfectly if the name is given from first name but didn't search on the string the second name. Where first and second both are saved in one value separated by space for example "John Smith". If search on "john" or "jo" etc it retrieve the record but if its smith it retrieve nothing. Code var ref = firebase

How to loop through $firebaseArray

会有一股神秘感。 提交于 2019-12-29 06:50:52
问题 I created an array of users like so - var ref = new Firebase(FIREBASE_URL + '/users'); var users = $firebaseArray(ref); I have added objects to this and I want to loop through each of the users in this array. I know this is possible in the view using ng-repeat, but I need to do it in the controller. I have tried - angular.forEach(users, function(user) { console.log(user); }) But I get no result from this. 回答1: Users probably isn't loaded by then, so you'll need to wait for it: var ref = new

Firebase data normalized. How should I fetch a collection based on this structure?

徘徊边缘 提交于 2019-12-28 03:38:11
问题 I think I am getting close, I am able to print out the ID of books belonging to a user but have been trying unsuccessfully to fetch the list of books belonging to a user, from the firebase books reference. I'm following loosely the tutorial here: http://www.thinkster.io/pick/eHPCs7s87O/angularjs-tutorial-learn-to-rapidly-build-real-time-web-apps-with-firebase#item-526e9330d90f99661f00046c and also reading the documentation about denormalizing data here: https://www.firebase.com/blog/2013-04

If I restructure data for use, how can I make Firebase automatically update it?

流过昼夜 提交于 2019-12-25 14:24:13
问题 If I use: var ref = new Firebase("https://myURL.firebaseio.com/"); var sync = $firebase(ref); var firebaseData= sync.$asObject(); firebaseData will change as data from https://myURL.firebaseio.com/ changes. They will be in sync. If I restructure data, and define it as some new variable var newStructure , how can I get it to sync with https://myURL.firebaseio.com/ or firebaseData ? Is there a way I can watch for changes in firebaseData and recall the restructuring method? Is there a way to

TypeError: undefined is not a function while submitting & deleting post using AngularFire and AngularJS (ThinksterIO Tutorial Chapter 7)

旧时模样 提交于 2019-12-25 11:59:40
问题 I've run into multiple TypeErrors with the Thinkster.io AngularJS Tutorial: Learn to build Modern Webapps Chapter 7. Creating your own user data using firebase since the tutorial is now outdated after AngularFire was upgraded to v0.8.0. Specifically the .$child() and .$on() methods have been taken out. Here is the change log https://github.com/firebase/angularfire/releases/tag/v0.8.0 After getting help solving my initial TypeError issues during registering a new user, I began to see 2 new

AngularFire - impossible to recover the time entered by the user in database

安稳与你 提交于 2019-12-25 05:46:31
问题 I've posted a precedent issue with my Background image in DIV. It's work successfully with current date. But when I want to adapt Background Image with time entered by user in database with model "starthourid", it's don't work (It display "night") ! But the database is OK, I can display "nameid" in HTML and "startdateid" with "starthourid". This is a part of my code : HTML : <div ng-repeat="event in events"> <div class="card" > <div class="sunrise item item-divider" ng-class="time"> <h2 class

AngularFire extending the service issue

岁酱吖の 提交于 2019-12-25 04:35:19
问题 I've been looking at the documentation for Synchronized Arrays https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-extending-the-services and https://www.firebase.com/docs/web/libraries/angular/guide/extending-services.html#section-firebasearray I'm using Firebase version 2.2.7 and AngularFire version 1.1.2 Using the code below, I'm having trouble recognizing $$removed events. .factory("ExtendedCourseList", ["$firebaseArray", function($firebaseArray) { // create a new

Get Firebase items belonging to category

删除回忆录丶 提交于 2019-12-25 04:09:20
问题 In my app I will have items. Each item belongs to at least one category, but multiple categories are possible. I think the following is the best way to structure the data: items item1 title: apple categories: food: true fruit: true item2 title: spinach categories: food: true veggie: true item3 title: triceratops categories: dino: true How do I query Firebase to return all items matching a category? For example: 'food' should return item1 and item2 and 'veggie' item2 . I'm using Angular Fire