ember.js

Trigger an action on the change event with Ember.js checkbox input helper?

心已入冬 提交于 2019-12-28 05:35:36
问题 How can I fire a named action upon changing a checkbox in Ember.js? Any help will be greatly appreciated. Here is what I have. Checking or unchecking the checkbox has no effect. Template: {{input type="checkbox" on="change" action="applyFilter"}} Controller: actions: { applyFilter: function() { console.log("applyFilter"); } } 回答1: using an observer seems like the easiest way to watch a checkbox changing Template {{input type='checkbox' checked=foo}} Code foo:undefined, watchFoo: function(){

Return a promise from a controller action in Ember?

久未见 提交于 2019-12-28 05:34:45
问题 I have a component that needs to communicate with a controller and eventually perform some clean up after the controller says everything is ok (ie, jQuery "un"-initialization). I think the best way to accomplish this is with a promise so that the component can clean up after the controller completes its task. But how can a controller action return a promise? Alternatively, can a component call a dynamic method directly on a controller? For example, lets say I have a ModalDialogComponent . App

Return a promise from a controller action in Ember?

淺唱寂寞╮ 提交于 2019-12-28 05:34:18
问题 I have a component that needs to communicate with a controller and eventually perform some clean up after the controller says everything is ok (ie, jQuery "un"-initialization). I think the best way to accomplish this is with a promise so that the component can clean up after the controller completes its task. But how can a controller action return a promise? Alternatively, can a component call a dynamic method directly on a controller? For example, lets say I have a ModalDialogComponent . App

What is the purpose of the Ember.Container

北城余情 提交于 2019-12-28 03:46:30
问题 Can anyone explain what the purpose of the Container module is in the latest Ember? An example of its usage, in the setup and in the start of this test: module("Ember.View - handlebars integration", { setup: function() { Ember.lookup = lookup = { Ember: Ember }; lookup.TemplateTests = TemplateTests = Ember.Namespace.create(); container = new Ember.Container(); container.optionsForType('template', { instantiate: false }); } test("template view should call the function of the associated

How to fire an event to Ember from another framework

我们两清 提交于 2019-12-28 03:23:07
问题 We are using version pre4 of ember. We have a framework (SignalR) working parallel with ember that handles real-time notifications to our application. In the older versions of ember we were able to access the global reference of the router / controller. But with the new version of Ember this is no longer possible. (This is fine) We have tried different approaches like setting up a global controller in the top route: setupController: function(){ app.appController = this.controllerFor('app'); }

Ember without Ember Data

强颜欢笑 提交于 2019-12-28 02:06:12
问题 Ember data is still not at version 1.0 and thus I decided to use Ember without Data models. I have my own models, and those are created by the route model function. However maintaining state between the frontend objects and the backend objects is a nightmare. Especially when one route uses another routes models. How can this be achieved, should I write my own store and model find method? Should I use Ember Data (even though it's not at version 1.0 ?) perhaps an ETA on Ember Data 1.0 ? write

API formation for side loading only required associated data to ember data

扶醉桌前 提交于 2019-12-26 00:49:17
问题 Please check my previous question EMBER JS - Fetch associated model data from back-end only when required Related to the above question I need help on API formation in ruby on rails(JSON format: jsonapi.org) how to form the API for sideloading only students.records and link with data already available in ember-data store (school and students) 回答1: based on the comments in the other question, I think you're wanting something like GET /api/students?include=records But you need that filtered to

API formation for side loading only required associated data to ember data

不想你离开。 提交于 2019-12-26 00:49:05
问题 Please check my previous question EMBER JS - Fetch associated model data from back-end only when required Related to the above question I need help on API formation in ruby on rails(JSON format: jsonapi.org) how to form the API for sideloading only students.records and link with data already available in ember-data store (school and students) 回答1: based on the comments in the other question, I think you're wanting something like GET /api/students?include=records But you need that filtered to

Postman not working on Ember with back-end JSON API

穿精又带淫゛_ 提交于 2019-12-25 19:37:32
问题 I am new to Ember and have posted a similar post regarding troubleshooting of a simple Ember front-end with JSON API web back-end (see below). My problem here is that I am unable to get Postman to display any data in the DevTools console - its blank. I can use Postman to submit requests and see the response in the body, that is all. I have tried various permutations of using the application while going so far as to uninstall and re-install. But, nothing is working. Is anyone aware of the

Rendering coordinates on leaflet map view using ajax in ember

谁都会走 提交于 2019-12-25 16:45:06
问题 []I am trying to feed data (via an ajax call to a json file) to both a handlebars template and a leaflet map. With my current setup, the data reaches my handlebars template just fine, but doesn't render the coordinates data to the leaflet map. I suspect I am missing some basic piece of the ember.js puzzle. Would someone please advise me? HTML/Handlebars Templates: <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui">