ember.js

Emberjs partial's action doesnt fire in component

吃可爱长大的小学妹 提交于 2019-12-13 04:18:37
问题 I try to extend a component (https://github.com/ember-addons/ember-forms) to make it possible to add extra button next to the form controls. The idea developer passes an extra property to the component, and a partial will be rendered next to the form control (input, select, textarea). Problem It works fine but if i have a partial with some action, the action wont fire. JsBin Here is a simplified JsBin which demonstrates the problem: http://jsbin.com/pexolude/105/edit html <script type="text/x

Ember: set array value for specific key

不羁岁月 提交于 2019-12-13 04:17:50
问题 How do I set a value for a specific array key in Ember? I tried ... var feed = this.get('controller.feed'); feed[i]['loadingFeedImage'] = false; this.set('controller.feed', feed); ... but the template doesn't recognize the changed value. I also tried this, but it doesn't work: this.get('controller.feed['+ i +'].loadingFeedImage', false); 回答1: I figured it out: Change the value like this: this.set('controller.feed.data.' + i +'.loadingFeedImage', false); (don't use square brackets). 回答2:

Observing changes to an ItemController in Array Controller

末鹿安然 提交于 2019-12-13 04:16:16
问题 I've been learning ember by recreating the TodoMVC in EmberCli. Ive recreated all the functionality, but I ran into an issue and I was hoping someone could shed some light on the situation. It seems that my Todos ArrayController will observe and fire functions when properties in my model change but not when values in my Todo ObjectController change. I moved isEditing into the Model so that when I call editTodo canToggle fires. But I would prefer to store that value in my controller and not

EmberJS sort Array Controller of Objects

这一生的挚爱 提交于 2019-12-13 04:05:03
问题 Trying to figure this concept out. If you console.log this.get("content") before and after the sort, everything seems like it worked, but when it displays to the screen it gets funky. I think the issue is with Handlebars. When it "sorts" it adds a duplicate fourth record and sticks it at the top. You can see the problem in action here: http://jsfiddle.net/skinneejoe/Qpkz5/78/ (Click the 'Sort by Age' text a couple times to resort the records and you'll see the issues) Am I doing something

Emberjs access a nested property

一曲冷凌霜 提交于 2019-12-13 04:03:33
问题 This question is the following of this one emberjs display an object return from an ajax call To resume a bit, I have a dynamic list generated with some button for each item of that list. I catch the event of any button with this class : App.EnquiriesView = Ember.View.extend({ didInsertElement: function() { var that = this; this.$().on('click', '.view-btn', function(){ var id = $(this).attr('data-value'); that.get('controller').send('clickBtn', id); }); } }); And it goes to my controller here

Ember nested route won't show?

空扰寡人 提交于 2019-12-13 04:01:44
问题 I've gone over the docs and I can't see what I'm doing wrong. Router.map App.Router.map(function(){ this.resource('users', function(){ this.resource('user', { path: ':user_id' }); this.resource('add'); }); }); handlebar <script type="text/x-handlebars" id="users/add"> <h3>Add User</h3> </script> I get the proper URL with my link-to: {{#link-to 'add'}}Add User{{/link-to}} However the contents of my handlebar template for users/add never show? Here are my Routes App.UsersRoute = Ember.Route

Architectural design of a Heroku application with Ember.js, Node.js and Express

给你一囗甜甜゛ 提交于 2019-12-13 03:46:36
问题 I'm starting to implement a Heroku application based on Ember (frontend), Node and Express (backend). I'm thinking to segregate the frontend and the backend in different apps. Both apps will be secured by Auth0. What do you think about it? I'm on the right way? 回答1: Yes, I think you're going about it the right way. My company has a Ruby on Rails backend and EmberJS frontend. We have the backend as one heroku app, and the frontend as another heroku app. For ember, we use Ember CLI Deploy to

Ember - Cli Error: spawn ENOENT

旧街凉风 提交于 2019-12-13 03:42:19
问题 I am cloning this project to run locally. These are the steps i have done in my Terminal git clone https://github.com/lrdiv/ember-soundcloud.git cd ember soundcloud ember install ember server I got this errors in my Terminal: And this is what i see in my http://localhost:4200/ Server is runnings, so this is good sign! but how can i fix it? 回答1: Try using ember-cli-sass instead of broccoli-ruby-sass in your package.json. Especially if you've updated the version of ember-cli from 0.0.39 Edit:

setting which controller to handle a certain action

夙愿已清 提交于 2019-12-13 03:38:49
问题 I'm using the structure of the Ember version of the TodoMVC app for an Ember app by which I mean that, after setting the application route to products export default Ember.Route.extend({ redirect: function(){ this.transitionTo('products'); } }); I then use the ul structure of the todo app, with each product occupying a new list position (as each todo does in the TodoMVC). I also (as with the Todo app) bind some attributes that allow me to set css styles depending on state <ul id="products"> {

Ember, change current url and LinkTo targets without reloading data

為{幸葍}努か 提交于 2019-12-13 03:36:49
问题 How to change an url and the LinkTo components without reloading data? Figure an app where a user can change the name of his project. The current url contains the project name, so it must be updated. Nothing excepts the url and the links must be modified (no data reload) Consider this main route: this.route('routeName', { path: '/:project_name/:param2/:param3' }, function () { ...many sub routes }); The replaceURL method allow to change the url: this.router.location.replaceURL