ember.js

Architecture for data layer that uses both localStorage and a REST remote server

巧了我就是萌 提交于 2019-12-20 08:53:08
问题 Anybody has any ideas or references on how to implement a data persistence layer that uses both a localStorage and a REST remote storage: The data of a certain client is stored with localStorage (using an ember-data indexedDB adapter). The locally stored data is synced with the remote server (using ember-data RESTadapter). The server gathers all data from clients. Using mathematical sets notation: Server = Client1 ∪ Client2 ∪ ... ∪ ClientN where, in general, any record may not be unique to a

Frontend javascript frameworks with node.js [closed]

佐手、 提交于 2019-12-20 08:48:43
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am starting to learn frontend JavaScript frameworks like Backbone.js or Embers.js and I wanted to do some projects in Node.js. I

Check for a value equals to in Ember Handlebar If block helper

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 08:46:44
问题 How do we check for a value equality in ember.js's If-block helper? {{#if person=="John"}} How do we perform above in handlebars? 回答1: The {{#if}} helper can only test for properties, not arbitrary expressions. The best thing to do in cases like this is therefore to write a property computing whatever conditional you want to test for. personIsJohn: function() { return this.get('person') === 'John'; }.property('person') Then do {{#if personIsJohn}} . Note: If you find this too limiting, you

How to specify async belongsTo/hasMany relationships in emberfire/emder-data?

北城以北 提交于 2019-12-20 07:22:22
问题 I am very new at Ember/ED/EmberFire so apologies if this is a trivial question. I am able to save records to Firebase but I am unable to specify relationships to those records in my controller. I am using DEBUG: Ember : 1.10.0 DEBUG: Ember Data : 1.0.0-beta.12 DEBUG: Firebase : 2.2.3 DEBUG: EmberFire : 1.4.3 DEBUG: jQuery : 1.11.2 I have a model as such: var Patient = DS.Model.extend({ lastName: DS.attr('string'), firstName: DS.attr('string'), encounters: DS.hasMany('encounter', {async: true}

Error Attempted to handle event `loadedData` : Object not updated after deleteRecord

为君一笑 提交于 2019-12-20 06:48:19
问题 Using the last version of ember-js and ember-data, I got an issue when deleting a record. My route : App.ListContactsRoute = Em.Route.extend({ model: function() { App.Contact.find(); }, setupController: function(controller, model) { controller.set('contacts', model); } }); App.EditContactRoute = Em.Route.extend({ setupController: function(controller, model) { this.transaction = controller.get('store').transaction(); this.transaction.add(model); controller.set('content', model); controller.set

How to observe for changes in the Ember data store?

丶灬走出姿态 提交于 2019-12-20 06:37:23
问题 I created this simple JsBin to demonstrate what I'm after. JSBIN I have some Fixture data and each item in it has a boolean property called isFavourite. The indexRoute just displays all the available data along with a second section that displays the items that are favourites. Each item also has a class binding to this isFavourite property. If it's a favourite, it'll have red text. There is a second route called dashboard which only displays a subset of the data from the store. There is also

Action Handlers Not Working on View itself

ぃ、小莉子 提交于 2019-12-20 06:29:58
问题 Do action handlers not work directly on view instances? Instead of attaching an action handler within the view, I want to attach it directly on the entire view itself. Sample jsFiddle: http://jsfiddle.net/t3wdG/ UPDATE: My goal is to delegate to specific functions (undo, redo in this case) on the parentView. The reason I have the buttonView is because on click on each button, I want to do something to it, for example add a css class to it. So in effect, I want all my buttons to add a class to

Guidance on how to setup the basic “Components” example from the official EmberJS homepage

微笑、不失礼 提交于 2019-12-20 06:04:30
问题 My background is in old-school web development and LAMP stack development mixed with Linux server administration. Meaning I can code HTML, PHP, CSS and JavsScript—as well as manage a Linux server—with ease. But have decided I need to be a bit “modern” as far as web client side technology goes and am teaching myself EmberJS on my Mac OS X 10.9.5 machine. Core versions are as follows: Ember CLI version: 1.13.12 Node JS version: 4.2.2 NPM (Node Package Manager) version: 2.14.10 Watchman: 4.1.0

Ember data: save loses belongsTo relationship

拜拜、爱过 提交于 2019-12-20 05:59:11
问题 I have the following problem: A form with a select field for selecting the category of a post. Let's say the post has category 100. In Ember inspector, this is shown as follows: category: <App.Category:ember708:100> When I save the post (via Ember Data 1.0.0 beta 2), the category suddenly changes to: category: 100 And the value is no longer selected in the select list. It is cleared. Code to save: post.save().then( function () { alert("Save OK"); } ) Any idea in which direction I need to

Ember — observe for creation/deletion of records

梦想的初衷 提交于 2019-12-20 05:39:27
问题 Let's say I have 2 independent set of controllers/models: Dog and Cat . Now, whenever I create new Cat record (or delete existing one) I want Dog controller to observe for creation/deletion of the record and when new Cat record is created I want it to fire some action (for example console.log('Bark!') ). I don't want to send action from Cat controller to Dog controller directly in this case; I want Dog controller to be responsible for itself. In case it is possible, is there any way to tell