I am using Ionic and AngularFire to build my app, but I have encountered a new issue: the form data is empty! Only the fields in my Firebase database are visible. How can I retrieve the user-entered form data from the Firebase database?
Here is a screenshot of the issue:
This is the HTML code snippet:
<form ng-submit="submitEvent(event)">
<label class="item item-input item-stacked-label">
<span class="input-label"><i class="fa fa-pencil"></i> Event Name</span>
<input type="text" ng-model="event.nameid">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label"><i class="icon ion-ios-information"></i> Description</span>
<br><textarea ng-model="event.descriptionid"></textarea>
</label>
<label class="item item-input item-stacked-label">
<span class="input-label"><i class="fa fa-location-arrow"></i> Address</span>
<input type="text" ng-model="event.addressid">
</label>
<button class="button" type="submit" value="Add Event" id="success-btn-create"><i class="fa fa-arrow-right"></i></button></form>
This is the Controller JS code snippet:
myApp.controller('Step1Ctrl', ['$scope', 'Event', 'Auth', '$rootScope', '$state', '$firebaseArray', function($scope, Event, Auth, $rootScope, $state, $firebaseArray) {
$scope.submitEvent = function(event) {
var nameid = $scope.nameid;
var eventRef = new Firebase("https://myApp.firebaseio.com/Events");
eventRef.push($scope.event);
$scope.event = {nameid: '', descriptionid: '', adressid: ''};
}
$scope.deleteEvent = function(index) {
$scope.events.splice(index , 1);
}
}])
This is the Service JS code snippet:
myApp.factory("Event", ["$firebaseArray", function($firebaseArray) {
var eventRef = new Firebase('https://myApp.firebaseio.com/Events/');
return $firebaseArray(eventRef);
}]);
One additional question: how do I retrieve the name of the organizer who is logged in with Facebook?
Thank you all!