ember-cli

SASS with Ember CLI addons

对着背影说爱祢 提交于 2019-12-01 19:01:03
I'd like to know how I can use SASS within an Ember-CLI addon? I have my styles in /app/styles folder, but I'm not sure that's the right location to have them. I have broccoli-sass installed in my addon project, my Dummy test website compiles properly the scss files when I include my folder in /tests/dummy/app/styles/app.scss . @import 'app/styles/app.scss'; But I don't know how I can compile the scss files to go into the /dist/assets/vendors.css , which is the file loaded by projects using this addon. OK I just found out the solution The style folder needs to be in /addon/styles instead of

makeBoundHelper alternative in Ember 2.0

痞子三分冷 提交于 2019-12-01 18:51:19
I've been injecting Google DFP ads in my blog-posts by using a bound helper so far. Since all Handlebars APIs have been removed in Ember 2.0 what can I use as of Ember 2.0 instead? import Ember from "ember"; export default Ember.Handlebars.makeBoundHelper(function(value, options) { var parsedHtml = Ember.$('<div />').html(value) // Push the ads after the divs have been rendered Ember.run.schedule('afterRender', function() { googletag.cmd.push(function() { googletag.display('div-gpt-ad-111111111-0'); }); }) } return parsedHtml.html() }); You would use the Ember.Helper.helper syntax: import

Building with ember CLI in production environment

∥☆過路亽.° 提交于 2019-12-01 18:05:47
问题 Running ember server works fine locally on my dev machine but how do I do it on my host? All I can do is upload the dist folder which contains the output of the CLI build. But when I navigate to it there is a blank page. 回答1: Ember serve/server/s fires up a server for local development, you shouldn't use it's files to deploy on a live host. Starts up the server. Default port is 4200. Use --proxy flag to proxy all ajax requests to the given address. For example ember server --proxy http://127

Building with ember CLI in production environment

好久不见. 提交于 2019-12-01 17:55:47
Running ember server works fine locally on my dev machine but how do I do it on my host? All I can do is upload the dist folder which contains the output of the CLI build. But when I navigate to it there is a blank page. Ember serve/server/s fires up a server for local development, you shouldn't use it's files to deploy on a live host. Starts up the server. Default port is 4200. Use --proxy flag to proxy all ajax requests to the given address. For example ember server --proxy http://127.0.0.1:8080 will proxy all your apps XHR to your server running at port 8080. When you want to deploy you

makeBoundHelper alternative in Ember 2.0

淺唱寂寞╮ 提交于 2019-12-01 17:18:52
问题 I've been injecting Google DFP ads in my blog-posts by using a bound helper so far. Since all Handlebars APIs have been removed in Ember 2.0 what can I use as of Ember 2.0 instead? import Ember from "ember"; export default Ember.Handlebars.makeBoundHelper(function(value, options) { var parsedHtml = Ember.$('<div />').html(value) // Push the ads after the divs have been rendered Ember.run.schedule('afterRender', function() { googletag.cmd.push(function() { googletag.display('div-gpt-ad

EmberJS Service Injection for Unit Tests (Ember QUnit)

纵饮孤独 提交于 2019-12-01 16:55:46
Specs: Ember version: 1.13.8 node: 0.10.33 npm: 2.13.4 I have import Alias from "../../../services/alias"; .... moduleFor("controller:test", "Controller: test", { integration: true, beforeEach: function() { this.register('service:alias', Alias, {singleton: true}); this.inject.service('alias', { as: 'alias' }); this.advanceReadiness(); }, }); ... test('Alias Alias Alias ', function(assert) { var controller = this.subject(); //sample function controller.send("test"); assert.equal(true, controller.alias.get("alias"), "alias should be true"); }); (Using 'alias' as example because I'm not allow to

Using Instance Initializers with Ember 1.12.0 and the Ember CLI

五迷三道 提交于 2019-12-01 15:46:28
After updating my app to Ember 1.12.0, I notice lots of warnings like this: lookup was called on a Registry. The initializer API no longer receives a container, and you should use an instanceInitializer to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details. This seems to be caused by using container.lookup from an initializer, which was fine in older versions of Ember. From the blog post about Ember 1.12.0, it seems like in a Global-based Ember application, the difference between making an

EmberJS Service Injection for Unit Tests (Ember QUnit)

落花浮王杯 提交于 2019-12-01 14:51:10
问题 Specs: Ember version: 1.13.8 node: 0.10.33 npm: 2.13.4 I have import Alias from "../../../services/alias"; .... moduleFor("controller:test", "Controller: test", { integration: true, beforeEach: function() { this.register('service:alias', Alias, {singleton: true}); this.inject.service('alias', { as: 'alias' }); this.advanceReadiness(); }, }); ... test('Alias Alias Alias ', function(assert) { var controller = this.subject(); //sample function controller.send("test"); assert.equal(true,

Using Instance Initializers with Ember 1.12.0 and the Ember CLI

最后都变了- 提交于 2019-12-01 13:52:48
问题 After updating my app to Ember 1.12.0, I notice lots of warnings like this: lookup was called on a Registry. The initializer API no longer receives a container, and you should use an instanceInitializer to look up objects from the container. See http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers for more details. This seems to be caused by using container.lookup from an initializer, which was fine in older versions of Ember. From the blog post about Ember

New Ember app gives blank screen

∥☆過路亽.° 提交于 2019-12-01 06:20:50
问题 I'm new to ember and doing a introductory tutorial to build a simple app. When I create a new app and start server, I try visiting the localhost page (http://localhost:4200/) in my browser but the page is blank. The browser window title is of my app name but there is no "Welcome to Ember" text as their should be. Also the ember inspector says "Ember application not detected!" although the little ember icon appears in the address bar of Firefox indicating that there is an ember app. I have