ember-cli

How to get access to global variable in template?

混江龙づ霸主 提交于 2019-12-08 05:12:55
问题 I want to create global object with settings which I need to get from REST API. I need to make one request to REST API and get settings and after that I want to get access to these settings from any controllers and from any templates. What can you advice, what is the best practice for that problem? 回答1: Concept Good practice would be to use initializers. They allow injection of any data to routes, controllers or any other kind of object. Lets take an example ( example from Ember.js official

how to deploy ember-cli + rails app on heroku

雨燕双飞 提交于 2019-12-08 04:50:10
问题 I am trying to deploy an Ember-cli app by copying the files generated by ember build into the rails public folder following the approach shown in: http://blog.abuiles.com/blog/2014/05/21/deploying-ember-cli-and-rails-to-heroku/ https://github.com/dockyard/ember-cli-plus-backend/tree/rails-served-html/frontend/app But it doesn't seem to work as shown in the app on heroku , rather than display the content, it displays raw json on the web page which suggests the emberjs route model hook is not

How do I add Projects parent to Ember-CLI TodoMVC?

﹥>﹥吖頭↗ 提交于 2019-12-08 04:12:47
问题 I am working on a todo type project using Ember-CLI. I used as a starting point the nifty todoMVC project, but built with Ember-CLI using this guide: http://blaketv.com/2014/10/03/ember-cli-todo-mvc-tutorial-0-0-47// My question is, how would I go about adding projects at the parent level. So we would have a master-detail type interface and in the sidebar we would have projects and you could CRUD project names, and then when you click on a project name, you see the todos in the detail pane. I

Ember-cli: importing blanket.js causes test runners to hang

社会主义新天地 提交于 2019-12-07 12:30:04
问题 I'm currently using ember-cli with ember-qUnit for testing. I would also like to add code coverage results to the test output, so after some research blanketjs seemed the way to go. I installed blanket using: npm install blanket And moved the blanket folder into the ember-cli vendor folder. As I understand the way to import libraries is through the Brocfile.js which I am doing like so: app.import('vendor/blanket/dist/qunit/blanket.js'); Using ember inspector it appears that blanket has been

Access window object in ember-cli environment

守給你的承諾、 提交于 2019-12-07 08:23:37
问题 Hi I am trying to use torii in a cordova application. My environment.js file looks as below. I an not able to access window document object to setup redirectUri. getting error undefined variable. how can I access window document object. module.exports = function (environment) { var ENV = { environment: environment, baseURL: '/', locationType: 'hash', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true } }, APP: { //

Dynamic module import in Ember CLI

不打扰是莪最后的温柔 提交于 2019-12-07 07:53:05
问题 I have a bunch of modules defined in an Ember CLI app and each starts with the same path. I would like to import the modules into a module in the app. For example, I could write: import post1 from 'posts/1'; import post2 from 'posts/2'; import post3 from 'posts/3'; export default Em.ObjectController.extend({ posts: Em.A(post1, post2, post3), }); However, I do not know the module names because they are created/named on the fly by a precompiler. All I know is that the path always begins with

'equal' is not defined : Ember-qunit does not seem to be importing

做~自己de王妃 提交于 2019-12-07 05:36:15
问题 It appears the Qunit test methods aren't available even though I'm pretty sure I am importing them correctly. I get the following errors: unit/models/friend-test.js: line 11, col 3, 'ok' is not defined. unit/models/friend-test.js: line 17, col 3, 'equal' is not defined. unit/models/friend-test.js: line 23, col 3, 'equal' is not defined. unit/models/friend-test.js: line 31, col 3, 'equal' is not defined. unit/models/friend-test.js: line 32, col 3, 'equal' is not defined. I have this test file

Access constant in an Ember template

左心房为你撑大大i 提交于 2019-12-07 04:38:29
问题 Not sure what the proper "Ember Way" is to do this. I have the following template, where I want to have three task-item-list component instances, each for a different taskState value. Obviously, I would like to get rid of the magic numbers. <h4>Tasks:</h4> <div><h5>Backlog:</h5> {{ task-item-list tasks=model taskState=101 }} </div> <div><h5>Working:</h5> {{ task-item-list tasks=model taskState=202 }} </div> <div><h5>Done!</h5> {{ task-item-list tasks=model taskState=303 }} </div> Thanks to

ember cli and livereload: how to get it to work?

微笑、不失礼 提交于 2019-12-07 00:31:38
问题 I can't for the life of me get livereload to work with my ember cli project. This is the first time I try livereload, so I don't know if this problem is specific to ember cli, or if my Mac environment is not set up for it. Here is what I have installed $ ember --version: version: 0.0.46 node: 0.10.32 npm: 1.4.27 Here is how I got everything running: $ ember new foo-bar $ cd foo-bar $ ember server version: 0.0.46 Livereload server on port 35729 Serving on http://0.0.0.0:4200 Navigating to http

Including dependencies with ember-cli

与世无争的帅哥 提交于 2019-12-06 21:38:28
问题 I am trying out ember-cli to get an ember project going, however I have previously relied on rails and the asset pipeline to compile all my js and (s)css for previous projects. I admit a weak understanding of js build tools, so apologies if the question is basic: How can I see what dependencies are being compiled/included in the build? Specifically, I want to include both zurb-foundation and ember-leaflet in my project. I am not sure if they are there (at least the leaflet map is not showing