ember-cli

Create a for loop that will iterate a certain number of times in Ember-CLI

為{幸葍}努か 提交于 2019-12-18 05:52:19
问题 I am in a situation in which I would like to be able to have a component or helper that would allow me to iterate a number of times and output the enclosed block each time. Something like this: {{#incremented-for 2}} block to output {{/incremented-for}} I tried to set this up as a component, but was not able to figure out a way to make it work. I also tried to set it up as a helper, and was able to find some code that seems like it should work: export function incrementedFor(n, block) { var

Ember CLI and ASP.NET

旧巷老猫 提交于 2019-12-18 03:22:16
问题 I've successfully used the EmberJS JavaScript framework with an ASP.NET web application, by referencing ember.js file. I'm under the impression that Ember-CLI is the way Ember will be heading in future versions. If this is correct, what's the appropriate way to keep using Ember going forward? Does it make sense to use Ember-CLI with ASP.NET, or is the assumption that the client is only ever static HTML and CSS/JS that calls back to server-side code (eg. WebAPI)? 回答1: Ember-Cli is just the

{{content-for 'head'}} Ember-cli

拟墨画扇 提交于 2019-12-17 22:38:06
问题 I've been using Yeoman ember generator for the past 1 month and now, I'd like to give ember-cli a try. I run the generator and launch the app, everything works fine. ember new my-new-app ember server but I'd like to know how does {{content-for 'head'}} in app/index.html works? When looking at other examples from http://www.ember-cli.com/#tutorials, none of them are using this particular helper? Is it because they are using older version of ember-cli? Why weren't they using this content-for

Recommended way to include bootstrap library in Ember.JS ember-cli App

心已入冬 提交于 2019-12-17 06:24:32
问题 I am trying to install properly Twitter Bootstrap in my current ember-cli project. I did install bootstrap with bower : bower install --save bootstrap Now the library is downloded in /vendor/bootstrap/dist/(css|js|fonts) I tried what is mentioned here : http://ember-cli.com/#managing-dependencies replacing path and css files names but I get errors regarding the Brocfile.js file. I think the brocfile format has changed too much compared to the example. I also tried to @import with the /app

Insert partial/component at dynamic location

痴心易碎 提交于 2019-12-14 04:25:08
问题 I created a blog where I've got a {{downloads}} component showing the downloads which belong to a post. Currently I render the downloads below {{{post.content}}} . I'd like to have a special string withing post.content like [postDownloads] and render {{downloads}} there. Is this somehow possible or are there other approaches to solve this problem? I put together an easy example illustrating one of the use-cases I'm trying to solve: http://emberjs.jsbin.com/raresalihu/3/edit App = Ember

blanket.js not working with qunit in Ember-cli

二次信任 提交于 2019-12-14 02:45:05
问题 I would like to run blanket.js with qunit in my Ember-Cli app - I would like to avoid adding in grunt for only this purpose Tried to use npm install --save-dev blanket ( putting it in the node_modules dir ) and then putting the following in my index.html ( from my test dir ) <script> window.CioMobileENV = {{ENV}}; window.EmberENV = window.CioMobileENV.EmberENV; debugger; </script> <script src="assets/qunit.js"></script> <script src="assets/qunit-notifications.js"></script> <script src=

Ember Simple Auth (with token plugin) won't add the Authorization header with the token

牧云@^-^@ 提交于 2019-12-13 18:18:10
问题 I had a simple and working application with Ember CLI 0.1.12. I use the Ember Simple Auth addon with the Token authenticator and authorizer. https://github.com/jpadilla/ember-cli-simple-auth-token First, I wasn't able to authenticate, because I had no idea what the server was supposed to return. After a lot of googling, I was able to figure out that the server should return something like this: { "access_token": "ToKeN123hEre" } Now I was able to authenticate and sessions work. But when I

Ember CLI fails in production

…衆ロ難τιáo~ 提交于 2019-12-13 15:46:53
问题 I am deploying an Ember CLI app through jenkins and publishing it using nginx. Here is by jenkins build script: npm install bower install node_modules/ember-cli/bin/ember build --environment=production The nginx configuration simply directs sub.domain.com to jenkins\jobs\lastStable\archive\dist . That works fine, but when I go the page, it is blank and the following output in the console: TypeError: Ember.Handlebars.compile is not a function vendor-92ab6507ac60a5bf7c6819aa8fc418d6.js:18

How to do dependency injection in Ember with Ember CLI?

江枫思渺然 提交于 2019-12-13 14:33:11
问题 First, I made a small Ember app without Ember CLI. I had this piece of code. window.MyApp = Ember.Application.create({ ready: function() { this.register('session:current', MyApp.SessionController, { singleton: true }); this.inject('controller', 'session', 'session:current'); } }); This worked. Then I decided to rewrite everything from scratch with Ember CLI. I edited the file app/app.js and added the ready hook just like in my previous version. var App = Ember.Application.extend({

Custom authenticator with Ember simple auth + Ember CLI

荒凉一梦 提交于 2019-12-13 14:23:28
问题 I'm trying to write a custom authenticator, similar to the one from this example in the docs. The goal is to be able to retrieve the currently logged in user via session.user . I'm using Ember CLI, so in initializers/authentication.js I have import Ember from 'ember'; var customAuthenticator = Ember.SimpleAuth.Authenticators.Devise.extend({ authenticate: function(credentials) { debugger; } }); export default { name: 'authentication', initialize: function(container, application) { Ember