jeudi 30 juin 2016

How to fetch the data

Please tell me how to fetch the data from firebase

app/template/gmap.hbs

  

  

 
 
 
 

 

app/controller/newcase.js

 import Ember from 'ember';
 export default Ember.Controller.extend({
 actions:{
 addCase: function() {
 var hname = this.get('hname');
 var location = this.get('location');
 var latitude = this.get ('latitude');
 var longitude = this.get('longitude');
 var newCase = this.store.createRecord('case', {
 hname : hname,
 location : location,
 latitude : latitude,
 longitude : longitude
});
 newCase.save();
 this.setProperties({
 hname: ' ',
 location: ' ',
 latitude: ' ',
 longitude: ' '
});
 }

} });

app/controller/gmap.js

  import  Ember from 'ember';
  export default Ember.Controller.extend ({
 });

app/model/case.js

import Model from 'ember-data/model';
import attr from 'ember-data/attr';
 export default Model.extend({
 hname : attr('string'),
 location: attr('string'),
 latitude: attr('number'),
 longitude: attr('number')
 });

app/route/newcase.js

import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.get('store').findAll('case');
 }

});

firebase data1

i want to display that location, lat and lng in map i am not getting how to display please tell me how to write code for that




Aucun commentaire:

Enregistrer un commentaire