I try to use the GoogleMap Autocomplete component. This Google Javascript service needs simply to be binded to an input field.
My idea was to create a new View extending TextField and do the binding as described bellow: I have a doubt regarding the "this" in the Autocomplete constructor (this, option). As you can easily understand,this is for me the input component... (the error it perhaps here)
App.AutoCompleAddressView = Ember.TextField.extend({
type: 'text',
init: function() {
this._super();
var options = {
types: ['(cities)'],
componentRestrictions: {country: 'fr'}
};
autocomplete = new google.maps.places.Autocomplete(this, options);
}
});
and the html code template:
{{view App.AutoCompleAddressView}}
Unfortunately I get an Ember error: Uncaught TypeError: Object has no method 'getAttribute'