JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
<script type="text/x-handlebars" data-template-name="application">
{{view MyApp.AutoCompleteView}}
</script>
JavaScript
MyApp = Ember.Application.create({
autoinit: false
});
MyApp.router = Ember.Router.create({
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/'
})
})
});
MyApp.ApplicationController = Ember.Controller.extend({
content: ['a', 'b', 'c']
});
MyApp.AutoCompleAddressView = Ember.TextField.extend({
type: 'text',
didInsertElement: function() {
var options = {
types: ['(cities)'],
componentRestrictions: {country: 'fr'}
};
//this.$() return the element as an array form, but google autocomplete seems to not accept this. So take the first one.
new google.maps.places.Autocomplete(this.$()[0], options);
}
});
MyApp.initialize(MyApp.router);