ember-cli

how to trigger element features after render in ember-cli

雨燕双飞 提交于 2019-12-10 10:26:36
问题 I want to add tooltips onto a button in a component that can appear based on a set of results back from the server. (i.e. action buttons for delete, edit etc.) I have created a “search” component that is rendering into the application and when a search button is clicked the server may return a number of rows into that same search component template. so for example: My-app/pods/factual-data/template.hbs Contains: … {{#if results}} <div class="row"> <div class="col-sm-3"><b>Factual ID</b></div>

Input helper valueBinding is deprecated - what's the alternative?

大憨熊 提交于 2019-12-10 10:02:09
问题 I've got a few text-input helper like this {{input type="text" valueBinding="name" focus-out="focusOutName"}} I just upgraded Ember to 1.11.0 and now get this deprecation warning: DEPRECATION: You're attempting to render a view by passing valueBinding to a view helper, but this syntax is deprecated. You should use value=someValue instead. However when using value it is not bound in the controller and value simply sets the text to whatever value. How do I correctly bind it? 回答1: You should

ReferenceError: Can't find variable: define at http://localhost:7357/assets/test-loader.js, line 3

断了今生、忘了曾经 提交于 2019-12-10 06:13:26
问题 I'm upgrading my Ember CLI addon from 0.1.9 to 0.2.0, and am hitting this error when running ember test --server : ReferenceError: Can't find variable: define at http://localhost:7357/assets/test-loader.js, line 3 ember serve works, and I can visit /tests in the browser, but something else seems to have broken the testem/phantom setup. I've upgraded Phantom, and went through the ember init diffs several times, but I must still be missing something. 回答1: The problem was I had used ES6 syntax

How do I get cookies to to be sent with my requests to the backend in ember app?

白昼怎懂夜的黑 提交于 2019-12-10 04:29:14
问题 Is there a way in Ember to send cookies with the requests to the backend? For example: if my client URL is protocol://example.com . The cookies that belong to the same domain will be in the request header when I navigate to protocol://example.com/profile . However, they do not persist in the subsequent request/s the profile route model method makes -> example to protocol://example-host/posts . How do I make those cookies persist? /app/routes/profile.js : import Ember from "ember"; import

In Ember 1.13 and later what key should I use with each when iterating over an array of strings?

江枫思渺然 提交于 2019-12-10 00:47:58
问题 In Ember 1.13 the following code generates a warning: {{#each widgetNames as |widgetName|}} {{component widgetName removeWidget="removeWidget"}} {{/each}} Where widgetNames is an array of strings in a parent controller. widgetNames: [] In Ember 1.13 I now get this warning: WARNING: Using {{each}} without specifying a key can lead to unusual behavior. Please specify a key that identifies a unique value on each item being iterated. E.g. {{each model key="@guid" as |item|}} . This would be easy

Disable / turn off LiveReload server in Emberjs / Ember-cli

China☆狼群 提交于 2019-12-10 00:39:57
问题 I use Cloud9 IDE, which only exposes port 80 and prevents LiveReload from connecting. I get this error: GET https://myapp.c9.io:35729/livereload.js?snipver=1 net::ERR_CONNECTION_REFUSED Unless someone knows of a fix, I'd like to simply turn this feature off / disable it. I'm running Ember-cli and I can see the task in ember-cli/lib/tasks/serve.js and I've commented it out, but it didn't do the trick: /* var liveReloadServer = new LiveReloadServer({ ui: this.ui, analytics: this.analytics,

How do I customize the view element for the application.hbs template?

丶灬走出姿态 提交于 2019-12-09 21:03:00
问题 In an app generated by ember-cli, the html generated by application.hbs is wrapped in a view: <body class="ember-application"> <div id="ember284" class="ember-view"> </div> </body> If I create a component, I have a component-name.js file where I can specify options to modify the component: export default Ember.Component.extend({ tagName: 'nav', classNames: ['main-menu'], layout: layout }); How do I modify the attributes of the element that is wrapping the application.hbs template? 回答1: create

How to upgrade ember cli version

半城伤御伤魂 提交于 2019-12-09 16:50:46
问题 I upgraded ember-cli to version 2.4.3 npm install -g ember-cli I can see -- ember-cli@2.4.3 , in the listed dependencies, but when I check : (master *)$ ember -v version: 2.4.2 node: 5.6.0 os: darwin x64 ember cli version is still 2.4.2 what's wrong ? 回答1: Updating Ember-CLI's version and ember project's version are different thing. To update Ember-CLI: npm uninstall -g ember-cli npm cache clean bower cache clean npm install -g ember-cli@1.13.14 To update your project: rm -rf node_modules

Why ember-cli uses extend instead of create?

為{幸葍}努か 提交于 2019-12-09 11:15:51
问题 In a new ember App you write first: var App = Ember.Application.create({ test: 'foo', ... }); In a new ember-cli App you write first: var App = Ember.Application.extend({ test: 'foo', ... }); Why? ( In the second case, I can't read a global property (App.test) from a controller. !? ) 回答1: This question actually has a lot to do with Ember.Object . .extend() creates a new class that extends the old one, with class-level properties defined in the hash that is passed in. .create() create a new

Ember CLI with Multiple Proxies

一曲冷凌霜 提交于 2019-12-09 10:16:53
问题 The Problem: I have an Ember CLI Application that will consume multiple APIs, which I need to proxy to in development mode. Background: I have a legacy api which exposes services at /api running on my local development machine at localhost:3000 I have a new api which exposes services at /myapp/api/v1 . These services were recently extracted from the legacy app, and comprises the majority of the application services used by the ember app. The ember app uses the baseURL of /myapp , as it is