ember.js

Add route to Ember Addon

女生的网名这么多〃 提交于 2019-12-12 10:46:28
问题 i'm developing ember addon and i need to share one route between all applications that use this addon but i don't know how to achieve that or if it's even possible. Already i've add routes in addon, but application that counsume addon, doesn't see this. Any suggestions? Thanks! 回答1: Yes it is possible. What you put in your addon's app directory will be merged with consuming applications' app directory. (Resource) Put your routes into the correct directories. On the other hand, you need to add

Cordova Pushplugin: ecb not called

南楼画角 提交于 2019-12-12 10:39:59
问题 I am trying to retrieve the device registration ID in order to send notifications to it from my backend. I already gave it several tries: Outside my Object GambifyApp.NotificationManager = window.GambifyApp.NotificationManager = Ember.Object.extend({ init: function(){ var pushNotification = window.plugins.pushNotification; window.GambifyApp.NotificationHandler = GambifyApp.NotificationHandler; if ( device.platform == 'android' || device.platform == 'Android' ) { console.log('pushNotification

serialize date attributes

巧了我就是萌 提交于 2019-12-12 10:35:25
问题 I am using active_model_serializers and ember.js. One of my models has a date attribute. In rails date attributes are serialized in the format of "YYYY-MM-DD". The problem; when ember-data de-serializes the date using the javascript Date constructor it assumes an "incorrect" timezone. *Incorrect is not the best word but it is incorrect because I want it to default to the current timezone. DS.Model date attribute parses date (YYYY-MM-DD) incorrectly I am thinking the active_model_serializer

Ember, working with a model

落爺英雄遲暮 提交于 2019-12-12 10:18:29
问题 I'm confused about how to set up retrieve information from my (dynamic) model in Ember.js Here is my model (works so far): App.Router.map(function() { this.resource('calendar', { path: '/calendar/:currentMonth'}); }); App.CalendarRoute = Ember.Route.extend({ model: function (params) { var obj = { daysList: calendar.getDaysInMonth("2013", params.currentMonth), currentMonth: params.currentMonth }; return obj; } }); I just want to get back the 'currentMonth' attribute: App.CalendarController =

Ember.handlebars boundIf didn't call calculated property

左心房为你撑大大i 提交于 2019-12-12 10:16:17
问题 I try to migrate project form Ember cli 0.1.2 to 0.1.15. Current problem is next: I have can-helper. It works fine at older ember but at newer version all can-blocks are absent. Can-helper use calculated property in model, so i try to set debugger into calculation function - it work on 0.1.2 and didn't work at 0.1.15 Original ember - 1.7.0-beta.1 Try migrate to ember - 1.9.1 As i found implementation of boundIf helper was changed. Have anybody some ideas / experience with such trouble? P.S.

How can I render a model's template in a list, only when on the model's route?

泪湿孤枕 提交于 2019-12-12 09:57:54
问题 I am iterating a list of entries and would like to display the content of each entry within the list, but only when on the respective entry's route. i.e. - When on route /entries/2 * link to entry 1 * link to entry 2 content for entry 2 * link to entry 3 Unfortunately, it seems I can't use {{outlet}} within the {{#each entry}} loop. Initially I tried to set isActive to true within setupController on the route, and check for that within the template, but it does not seem like there is a good

Handling Validation Errors in Ember.js

萝らか妹 提交于 2019-12-12 09:42:02
问题 I have a rails app serving json to an ember frontend. I am trying to display validation errors from on a form on the client. Rails is returning this json: {"errors":{"hometown":["is too long (maximum is 64 characters)"]}} In my handlebars template for the current route I am attempting to iterate through the errors but I don't get any output for the errors section: <div class="form-group"> <label>Hometown</label> {{#each errors.hometown}} {{this}} {{/each}} {{input type="text" class="form

How to access controller from route in Ember?

◇◆丶佛笑我妖孽 提交于 2019-12-12 09:28:38
问题 Is there any foolproof way to access controller from a route? <a href="#" class="btn" {{action "someAction" user}}>add</a> App.ApplicationRoute = Ember.Route.extend events: someAction: (user) -> console.log 'give me name from currentUser controller' The someAction is very general and I think that ApplicationRoute is the best place for it. 回答1: I think the method controllerFor should be available in this event: App.ApplicationRoute = Ember.Route.extend events: someAction: (user) -> console.log

Ember data - dynamic segments and query params together?

佐手、 提交于 2019-12-12 09:02:53
问题 Using Ember 1.8.0 and Ember Data 1.0.0-beta.11, Ember store's findQuery() function doesn't seem able to handle dynamic segments, or at least I'm not able to find it in documentation anywhere. For example, given the following routes MyApp.Router.map -> @resource 'users', -> @resource 'user' path: 'users/:user_id' , -> I know that store.findQuery('user', {foo: 'bar'}) sends a GET request to myapp.com/users?foo=bar and also, store.find('user', 1) sends a GET request to myapp.com/users/1 but now

Accordion wizard with multiple steps in ember

雨燕双飞 提交于 2019-12-12 08:59:49
问题 I am using ember to built a "wizard accordion" . Basically what I want is: an accordion which is always shown the accordion contains all the steps one step is active but it is also possibly to change the header of previous steps each step has its own model (e.g. Selecting from countries in first step, selecting from products in second) it should be possible to jump back and force between steps out of all the selections a central model is built which is sent to the server after the final step