ember.js

response undefined when calling google api thru emberjs

半世苍凉 提交于 2019-12-13 03:21:11
问题 I am trying to call google api for getting place suggestions from ember js. like below: this is the service module fetch(){ let url=`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=IL&types=geocode&key=API_KEY` return Ember.RSVP.resolve(Ember.$.ajax(url,{ method: 'GET' })) .then( (response)=>{ console.log("google suggested places:",response); return response; }) *the above url when served with API_KEY and pasted in browser, a JSON response is returned with the suggested

How can I use index while iterating over JSONArray in handlebar?

ε祈祈猫儿з 提交于 2019-12-13 02:58:22
问题 I am trying to show the details of the adultJsonArr in different and I want to get it saved on action without going into writing lengthy code. I'm not getting idea of how to use the index while iterating, I tried as mentioned in line no 5 but didn't work( @index also couldn't do job for me). Any suggestion on how to save the changes made to the input in the adultJsonArr 1.<form> 2. {{#each adultJsonArr as |adultTravellerDetails index|}} 3. <div id="adult_form{{index}}"> 4. Adult{{index}}: 5.

Ember-cli-rails No route match for ember's paths

巧了我就是萌 提交于 2019-12-13 02:58:11
问题 In a Rails and Ember project, I decided to use EmberCLI Rails because I want to do integration tests with Capybara and all my favorite testing gems. I installed it and it works when I go to the home page. I added routes on ember like this : import Ember from 'ember' import config from './config/environment' Router = Ember.Router.extend(location: config.locationType) Router.map -> @resource 'users' export default Router When I go on http://localhost:3000/users , I have a no route matches error

EmberJS - classNameBindings w/ Observe & Property Not Updating/Firing

血红的双手。 提交于 2019-12-13 02:54:56
问题 This is a really basic question and I've been trying to figure it out to no avail. I'm integrating Google Maps with EmberJS and trying to do classNameBindings on a property within the IndexController that is being set by another view. The values get updated properly, but it doesn't fire. I've tried both property('controller.panoEnabled') and also .observes('controller.panoEnabled'). Neither fires... any idea? Help is much appreciated and I apologize for this rudimentary question. JSBin: http:

Creating a new resource in ember

╄→尐↘猪︶ㄣ 提交于 2019-12-13 02:37:28
问题 I'm building an office reception app in Ember. When a person arrives at the office, they pop open the app and are taken through a three step wizard: Choose a reason for visiting Choose the person you've come to see Confirm The app also allows an administrator to view all of the visits and to view an individual visit. I have Visit and Person models I've hooked up to a server using Ember Data. Here's what my routes look like: App.Router.map () -> @resource 'visits', -> @resource 'visit', { path

setting data from route to controller error in Emberjs

醉酒当歌 提交于 2019-12-13 02:33:30
问题 i am a newbie in Emberjs.. I am trying to set data content from Emberjs route to controller to display in template.. i followed the suggestions here.. Access content inside a controller function ember works perfect.. but now i am getting this error Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed {items: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object], title: current mood} edit: here is also my code.

Error while using currentView feature of Ember.ContainerView in an each helper

偶尔善良 提交于 2019-12-13 02:11:20
问题 I would like to be able to swap views in a each helper using Ember.ContainerView. {{#each itemController="person"}} <li>{{view Ember.ContainerView currentViewBinding="cv"}}</li> {{/each}} It yields the following error: Something you did caused a view to re-render after it rendered but before it was inserted into the DOM It does work when I strip off the each helper. I know there is other ways to do that but it seems to me that it's a good use case for a ContainerView. Here is the jsFiddle :

Ember loop through an array of checkboxes and get checked items?

亡梦爱人 提交于 2019-12-13 01:59:25
问题 I have an Ember.js application (using the Ember CLI). I have a component called sideMenu with the files sideMenu.js and sideMenu.hbs . Within the .js file, I have an array of vehicle names like this: export default Ember.Component.extend({ vehicles: ['Audi', 'Chrysler', 'Harley Davidson'], vehicleCheckboxes: { 'Audi': true, 'Chrysler': true, 'Harley Davidson': true } }); In my template for this component, I am looping through these vehicles and creating a checkbox for each item like this: {{

ember 2 parameters in a action of a select menu

岁酱吖の 提交于 2019-12-13 01:26:40
问题 I'm trying to pass more than one argument in an ember action. The problem is that one of the arguments is value='target.value' and apparently Ember doesn't like to add a second one. How can I pass these two parameters? value='target.value' works if I only need one argument. I've tried to write it this way but category is undefined. {{#each selectorsData as |selectorItem|}} <select onchange={{ action selectorItem.action value='target.value' category='selectorItem.name' }}> I've tried this way

Using the es6 spread operator in htmlbars

喜夏-厌秋 提交于 2019-12-13 01:24:40
问题 Is is possible to use the equivalent of the spread operator in htmlbars? let items = ['hello', 'world']; someFunction(...items); // equivalent to someFunction('hello', 'world'); I need this in htmlbars {{link-to 'some.route' ...items}} 回答1: No, this is not possible afaik. I believe this PR request tries to implement it: https://github.com/wycats/handlebars.js/pull/1149. Unfortunately development on it doesn't seem to be very active. 来源: https://stackoverflow.com/questions/36808963/using-the