ember.js

DEPRECATION: ember-cli-babel 5.x has been deprecated. cant get ember work

痞子三分冷 提交于 2019-12-29 09:16:08
问题 i am trying to run my ember project and it said my babel is outdate , i update everything and noting work can anyone tell me how should i fix it ? here is what my npm return error looks like DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli-babel 6.6. Version 5.2.8 located: emma_drf_forms -> ember-cli-crudities -> ember-array-contains-helper -> ember-cli-babel DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli

`needs` not waiting for data to be returned before rendering template

女生的网名这么多〃 提交于 2019-12-29 08:07:11
问题 I am trying to implement a controller needing another ( CampaignsNew needing AppsIndex ), which looks like App.CampaignsNewController = Ember.Controller.extend({ needs: ['appsIndex'] }); And in my CampaignsNew template I am showing it via {{#if controllers.appsIndex.content.isUpdating}} {{view App.SpinnerView}} {{else}} {{#each controllers.appsIndex.content}} {{name}} {{/each}} {{/if}} However controllers.appsIndex.content.isUpdating is never true. I.e. it attempts to show the data before it

`needs` not waiting for data to be returned before rendering template

瘦欲@ 提交于 2019-12-29 08:07:07
问题 I am trying to implement a controller needing another ( CampaignsNew needing AppsIndex ), which looks like App.CampaignsNewController = Ember.Controller.extend({ needs: ['appsIndex'] }); And in my CampaignsNew template I am showing it via {{#if controllers.appsIndex.content.isUpdating}} {{view App.SpinnerView}} {{else}} {{#each controllers.appsIndex.content}} {{name}} {{/each}} {{/if}} However controllers.appsIndex.content.isUpdating is never true. I.e. it attempts to show the data before it

Using jquery in Ember-cli

懵懂的女人 提交于 2019-12-29 07:59:50
问题 I am relatively new to both Ember.js and Ember-cli and would really appreciate some help please with using a jquery tooltip in a custom view. All code is below, but when my template is injected, I get the following console error: [Error] TypeError: 'undefined' is not a function (evaluating 'Ember.$().tooltip()') I am using a custom view in a file called tooltip.js: import Ember from 'ember'; export default Ember.View.extend({ tagName: 'span', title: 'The tooltip title', html: true, placement:

Using jquery in Ember-cli

早过忘川 提交于 2019-12-29 07:59:09
问题 I am relatively new to both Ember.js and Ember-cli and would really appreciate some help please with using a jquery tooltip in a custom view. All code is below, but when my template is injected, I get the following console error: [Error] TypeError: 'undefined' is not a function (evaluating 'Ember.$().tooltip()') I am using a custom view in a file called tooltip.js: import Ember from 'ember'; export default Ember.View.extend({ tagName: 'span', title: 'The tooltip title', html: true, placement:

How can I make an Alert Notifications component using Ember.js?

跟風遠走 提交于 2019-12-29 07:21:10
问题 I want to include Alert Notifications in my Ember.js application like Bootstrap Alerts http://getbootstrap.com/javascript/#alerts but I want to be able to control the creation or destruction of notification objects instead of Bootstrap so I have more "Ember control" over the objects. How can I write an Ember.js Component to do this instead of using the Bootstrap JavaScript? 回答1: See a working demo here: http://jsbin.com/ceseku/3/edit?html,css,js,output Component Logic /** * Notifications

Ember.js + jQuery UI Draggable Clone

左心房为你撑大大i 提交于 2019-12-29 04:47:09
问题 I am trying to use Ember.js in conjunction with jQuery UI's draggable functionality, but I am encountering problems. Specifically, when using the clone helper, I am not able to drop the element and everything is extremely laggy. If I don't use the clone helper, everything works as expected. I suspect this is related to jQuery UI cloning the html, including all of the metamorph script tags (used for binding). I don't need to update the element live while I am dragging it. Is there a way to

Self-Join with Ember-Data

时光总嘲笑我的痴心妄想 提交于 2019-12-29 04:23:25
问题 Does anyone have any suggestions on how to manually create a self-join relationship using ember-data? If, for example, a user had many followers (other users), what would be the simplest way to build this data structure into ember-data? 回答1: Best way that we could find without going crazy was to proxy the self-join relationship with the relationship object, then just map that to the user. So if a user has many "users" through follows then you can do: App.User = DS.Model.extend name: DS.attr(

How do I retrieve the path of a route?

强颜欢笑 提交于 2019-12-28 16:16:07
问题 Given the following Router setup: App.Router.map(function() { this.resource('posts', function() { this.route('new'); this.resource('post', { path: ':post_id' }, function() { this.route('edit'); }); }); }); Is it possible to obtain the path of a route? Fictitious example: App.Router.get('path', 'posts.new'); //=> "/posts/new" Or with a model like: App.Router.get('path', 'post.edit', model); //=> "/posts/1/edit" 回答1: Try this in your console/dev tools: App.Router.router.generate(['posts.new']);

Compile template client side in ember using HTMLbars

六月ゝ 毕业季﹏ 提交于 2019-12-28 06:51:12
问题 I have created a CMS where it is be possible to use HTMLbars to create templates. The templates should be compiled client side and there is component that should display the template. I'm setting the template property of the component to a function that returns the compiled template using HTMLBars. import Ember from 'ember'; export default Ember.Component.extend({ content: null, template: function () { return Ember.HTMLBars.compile(this.get('content.template')); } } I've included the ember