AngularFire & Ionic - No Data Form Is Transmitted To Server
I use Ionic and AngularFire for make my app, but I have a (new) problem: My data form are empty ! We can see just the fiels in my DataBase Firebase. How do I do to retrieve the fo
Solution 1:
add this to your controller:
$scope.submitEvent = function(event) {
Event.add(event).then(function (data){
$scope.event = {nameid: null, descriptionid: null, adressid: null};
});
}
you can also reorganize your service as follows:
myApp.factory("Event", ["$firebaseArray", function($firebaseArray) {
var eventRef = new Firebase('https://myApp.firebaseio.com/Events/');
return {
get: function (){
return $firebaseArray(eventRef);
}
,
add: function (event){
var eventInfo = $firebaseArray(eventRef);
return eventInfo.$add(event);
}
}
}]);
hope this helps!
Post a Comment for "AngularFire & Ionic - No Data Form Is Transmitted To Server"