ember.js

Ember handlebars How can I make an Ajax or jquery call for an handlebar file?

℡╲_俬逩灬. 提交于 2019-12-25 03:26:42
问题 <div class="ui form segment"> <div class="field"> <div class="ui selection dropdown" tabindex="0"> <div class="default text"> Select </div> <i class="dropdown icon"></i><input name="hidden-field" type="hidden"> <div class="menu" tabindex="-1"> <div class="item" data-value="1"> Choice 1 </div> <div class="item" data-value="2"> Choice 2 </div> </div> </div> </div> </div> this code is written inside a template.hbs(handlebar) file. I want to initialise the drop down with the following command $('

Can I force 'active' class on a {{link-to}} helper?

╄→гoц情女王★ 提交于 2019-12-25 03:26:05
问题 Here is possibly an edge case for how ember adds the 'active' class on a link to helper. I have my current router set up like so: import Ember from 'ember'; var Router = Ember.Router.extend({ location: PortalDevENV.locationType }); Router.map(function() { this.resource('portal', function() { this.route('admin'); this.resource('placements', function() { this.route('import-debtors'); this.resource('add-debtor', function() { this.route('debtor-form'); }); this.route('view-debtors'); }); this

How would you bind a dynamic value to a dynamic component in Handlebars/EmberJS

大城市里の小女人 提交于 2019-12-25 02:57:08
问题 I'm creating a dynamic table component (one row per model), that will include components dynamically (one column for each object in config, each object relates to a key in a model). I'm trying to bind the model key to the dynamic model. Any ideas on how to do that given the following? Config object: deployment.js (controller) EDConfig: { controller: this, modelType: 'EscalationDetailModelGroup', table: { cols: [{ header: 'Escalation Time', cname: 'form-input-text', content: { value: model

Vendor directory not being generated during ember-cli project build

不想你离开。 提交于 2019-12-25 02:44:43
问题 I'm trying to build/run an ember-cli based project that I got from a colleague. When I try and run it with > ember server I'm getting the following error: > ember server version: 0.0.40 ENOENT, no such file or directory "vendor/" Error: ENOENT, no such file or directory "vendor/" at Object.fs.readdirSync (fs.js:654:18) at walkSync (/Users/ember/projects/ember/modal-example/node_modules/ember-cli/node_modules/walk-sync/index.js:14:20) at /Users/ember/projects/ember/modal-example/node_modules

Emberjs - Can a local storage adapter and a data storage adapter be used simultaneously?

断了今生、忘了曾经 提交于 2019-12-25 02:33:27
问题 Can a local storage adapter and a data storage adapter be used simultaneously? Here's some example code. VpcYeoman.ApplicationAdapter = DS.LSAdapter.extend({ namespace: 'viewpoint-emberjs' }); vs. VpcYeoman.Store = DS.Store.extend({ revision: 12, adapter: DS.FixtureAdapter.extend({ queryFixtures: function(fixtures, query, type) { return fixtures.filter(function(item) { for(prop in query) { if( item[prop] != query[prop]) { return false; } } return true; }); } }) }); Fight! Or coexist?? 回答1:

Output in multiple parts of the page

二次信任 提交于 2019-12-25 02:26:13
问题 index.html: <div id="section_a"> <script type="text/x-handlebars" data-template-name="index"> First value: {{input type="text" value=one}}<br> Second value: {{input type="text" value=two}}<br> Result: {{result}} </script> </div> <div id="section_b"> <!-- Display {{result}} here aswell --> </div> application.js App.IndexController = Ember.ObjectController.extend({ one: 0, two: 0, result: function() { return this.get('one') + this.get('two'); }.property('one', 'two') }); I have a section of a

Handlebars template not respecting view member when set from render helper

喜你入骨 提交于 2019-12-25 02:19:56
问题 I have a form that can filled out on its own or embedded into another form, as part of a larger object. When I {{render}} the form from the containing handlebars template, the child template does not respect the observable on the view. Parent template: {{render "EditIntro" introModule embedded=true}} Where introModule is a property on the containers model which returns a the specific submodel for the intro, which is a part of the parent. Child View: App.EditIntroView = Ember.View.extend({

multiple Ember.Select's bound to a single controller, selects do not synchronize at first in Firefox

馋奶兔 提交于 2019-12-25 02:14:07
问题 In this example: http://jsfiddle.net/5WrcD/2/ I have two Ember.Select s with selection bound to a single controller. Using Firefox (I'm running version 15.0 Mac), when I change the value of the first select , the second select does not change. If I then proceed to change the value of the second select to match the first, all subsequent changes to either select will be propagated to the other. Using Chrome/Safari the select s stay synchronized from the beginning. Could this possible be a bug

Ember Authentication paradigm

北慕城南 提交于 2019-12-25 02:08:54
问题 Let's consider a trivial use case: User edits his profile + we have a RESTful server. This means we have to send a token to the server and at the same time the new information about the editing. First, the server has to decode the token, and later to CRUD the DB. We want also to send back to the client a new json model about the new user profile. BUT the token is really a huge one, so we must send it with a POST request. We can send the additional information as a query string at the same

EmberJS Direct Slug URL Access Not Working

大憨熊 提交于 2019-12-25 02:08:33
问题 I am using slugged URLs for cleaner URLs to convert from this: http://mydomain.com/#/posts/1 to this: http://mydomain.com/#/posts/first-awesome-post The problem is that, if I were to directly access the page via direct slugged url (http://mydomain.com/#/posts/first-awesome-post), I got a blank page instead. Here is what I have: App.Router.map(function() { this.resource('posts', function() { this.resource('post', { path: ':post_id' }); }); }); App.Post.FIXTURES = [{ id: 1, name: 'First Awesome