ember.js

emberjs how to disable Ember.Select?

拟墨画扇 提交于 2019-12-24 03:01:19
问题 i have a similar question to this question Emberjs - Disable and Enable TextField so for text field it's disabledBinding. what about Ember.Select (drop down field)? i tried disabledBinding but it's not working. thanks! 回答1: It's not working because disabled is not defined in attributeBindings , see code. A solution is to extend the Ember.Select and add disabled to the concatenated property* attributeBindings , see http://jsfiddle.net/pangratz666/wTXfH/: Handlebars : <script type="text/x

Ember best practices for loading javascript/app only after authentication

雨燕双飞 提交于 2019-12-24 02:37:04
问题 Starting a new Ember app and was prepared to follow token authentication type structure for authentication in the restricted API routes but was then told we need to not show any of the javascript (or as absolute little as possible) before authentication. This has me a little puzzled given single page javascript apps. I'm using the, very helpful, ember-app-kit which has great tools that compile everything down to a minified and obfuscated single javascript file, which I thought was good enough

Could not find module ember-validations

我的未来我决定 提交于 2019-12-24 02:23:57
问题 Trying to use ember-validations plugin for ember-cli. Bumped with this issue that I can't figure what is missing. Here is the dependencies part in my package.json: "devDependencies": { "broccoli-asset-rev": "^2.0.0", "broccoli-ember-hbs-template-compiler": "^1.6.1", "ember-cli": "0.1.9", "ember-cli-6to5": "0.2.1", "ember-cli-content-security-policy": "0.3.0", "ember-cli-dependency-checker": "0.0.7", "ember-cli-ic-ajax": "0.1.1", "ember-cli-inject-live-reload": "^1.3.0", "ember-cli-qunit": "0

Where to add css and js files in ember-cli app?

痴心易碎 提交于 2019-12-24 02:16:16
问题 In rails, js files are located under app/assets/javascripts Similarly where to add js and css files in ember-cli app ? 回答1: app/styles/ should contain your stylesheets: Contains your stylesheets, whether SASS, LESS, Stylus, Compass, or plain CSS (though only one type is allowed, see Asset Compilation). These are all compiled into <app-name>.css If you need external JavaScript libraries, you should manage them in dependency sections of package.json and bower.json . You may have to include the

Invoke Ember action from plain JavaScript in iframe

那年仲夏 提交于 2019-12-24 02:09:20
问题 I have an iframe embedded in an ember app. How can I call a component's method from within the iframe? I guess I somehow need to get the ember instance via window.parent but how to do it and especially how to trigger an ember action? 回答1: You will face 2 problems. First, until frame's content is loaded from the same domain as app, it's completely isolated. But there is a way to communicate with such frame, window.postMessage So, within iframe, such code should be executed: window.parent

EmberJS - Manually bind controller to view

久未见 提交于 2019-12-24 01:59:13
问题 Lately EmberJS changed a lot (Router, ...) and the code I have started to write less than a month ago is now broken. One of the issue I have right now is I am not able to manually bind the controller to the view. I am using requireJS by the way... So I used to the able to do something like this (here to define the view for my menu and the menu items), to actually get the Controller content and selected properties. define ( 'app/common/views/menu', [ 'text!app/common/templates/menu.hbs',

How to convert JSON to store object?

百般思念 提交于 2019-12-24 01:57:10
问题 I have a JSON object from my Spring backend. How do I create a data object in my Ember application store? I tried: createObject() { var _this = this; $.getJSON('http://localhost:8080/object/getCard?id=24').then(function(response) { _this.store.createRecord('cards/object/card', response); }); } JSON: { "id":24, "fullName":"qwerty", "form":"zzzzzzzzzzzz", "leader": { "id":23, "fullName":"testName test", "email":"emailTest" } } I have a model in Ember app export default DS.Model.extend({

Testing error responses with ember-cli-mirage

本小妞迷上赌 提交于 2019-12-24 01:54:23
问题 I'm reading through ember-cli-mirage's docs about creating mock responses but can't figure out how to test error responses for the exact same request. For example: test("I can view the users", function() { var users = server.createList('user', 3); visit('/users'); andThen(function() { equal( find('li').length, 3 ); equal( find('li:first').text(), users[0].name ); }); }); test("I can view the error if viewing the users returns an error", function() { // somehow set up an error response (?)

Nested Views in Ember

空扰寡人 提交于 2019-12-24 01:53:57
问题 I've got the need for a recursive nested set of views in Ember. Basically think of it as a file structure with folders. I thought I could do it with render , but that didn't work. Inside structures/show view: {{#each child in structures}} {{ render 'structures/show' child }} {{/each}} I get the error: Uncaught Error: assertion failed: This view is already rendered I read in another SO Question about using the {{view}} helper: {{#each child in structure.structures}} {{ view App

How to import a library on Ember.js?

坚强是说给别人听的谎言 提交于 2019-12-24 01:42:54
问题 I am currently working with Ember.js. I have some issues importing some library into my application. First I downloaded this library http://www.acme.com/javascript/Clusterer2.js after that I was reading all the documentation in this Importing Javascript. But my main problem is I still don't know how to use it. I was searching and after long hours I found that in the application.hbs in the template that you generate with ember g template application that is in the folder ~\app\templates I have