Last active
July 4, 2016 00:15
-
-
Save allthesignals/8ff65d1b994a0d207cbbfd83d6030bfa to your computer and use it in GitHub Desktop.
MapzenAPIProblem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import Ember from 'ember'; | |
export default DS.JSONAPIAdapter.extend({ | |
urlForFindRecord(id, modelName, snapshot) { | |
let url = this._super(...arguments); | |
let query = Ember.get(snapshot, 'adapterOptions.query'); | |
if (query) { | |
url += '?' + Ember.$.param(query); // assumes no query params are present already | |
} | |
return url; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
ajax: Ember.inject.service(), | |
appName: 'Ember Twiddle', | |
response: null, | |
actions: { | |
action: function() { | |
var response = this.get('ajax').request('https://search.mapzen.com/v1/autocomplete', { | |
method: 'GET', | |
dataType: "json", | |
data: { | |
"text": 'Boston', | |
"api_key": "search-5f1bwRf" | |
} | |
}); | |
this.set('response', response); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js", | |
"ember": "2.3.2", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.3.2" | |
}, | |
"addons": { | |
"ember-ajax": "2.4.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment