{"id":3426,"date":"2014-03-24T19:49:42","date_gmt":"2014-03-24T19:49:42","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/24\/ember-jsrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-24T19:49:42","modified_gmt":"2014-03-24T19:49:42","slug":"ember-jsrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/24\/ember-jsrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"ember.jsRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4d8154b3f9ba6f4190483c5231d577d3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nken<br \/>\nember.js<br \/>\nIn the debugger it&#8217;s easy enough to get at the class definitions of objects I&#8217;ve created by typing in the App.ClassName.prototype. Ok not hugely interesting but still good when you&#8217;re first feeling around in the &#8220;Ember dark&#8221;. What about instances though? That&#8217;s really what I want access to. If my app has moved to the ActivitiesByDateRoute and instantiated the ActivitiesByDateController then there must be a instance of ActivitiesByDateController but what container is it stored in? I thought maybe<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/faa494f351d278e791c204263bbc7b8b?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\njeckyll2hide<br \/>\nember.js ember-data<br \/>\nI have the following model:App.Service = DS.Model.extend(App.NodeMixin, {properties : DS.belongsTo(&#8216;App.ServiceProperties&#8217;),&#8230;. });properties is an embedded property:App.Adapter.map(&#8216;App.Service&#8217;, {&#8230;properties: {embedded: &#8216;always&#8217;} });Whenever I want to create a new service, I create also the properties:this.transaction = this.get(&#8216;store&#8217;).transaction(); var entry = this.transaction.createRecord(App.Service, {}); var properties = App.ServiceProperties.createRecord(); entry.set(&#8216;properties&#8217;, p<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ee402d85a7677c3dbdd642108dc9efcb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nalalani<br \/>\nruby-on-rails ember.js mongoid ember-data<br \/>\nI have two models in Mongoid: Teams and Players where Players is embedded_in Teams. On the front end we use Ember.js and every time I add a new Player to a team I save the parent record (ie. the Team). Every time I update the parent record on the backend in rails I call Team.find(params[:id]).update_attributes(params[:team])Now the problem is each time I call update_attributes all the embedded objects (ie the players) get recreated with new ids and saved in the team. This is unexpected since I w<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/739dfa7b7b4580406c6e45fc8b3e3520?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAbdull<br \/>\nember.js ember-data<br \/>\nEmber Data&#8217;s documentation discusses different events in a model instance&#8217;s lifecycle. I would expect that the didUpdate event is triggered whenever any of a model instance&#8217;s properties change. But my experiments don&#8217;t show this behavior. Here is a JS Bin example: http:\/\/jsbin.com\/uziwam\/9\/edit In that example, you can see that I register handlers on the &#8220;ren&#8221; model instance: I register handlers (console.log(..) messages) for the didLoad and didUpdate events.When starting the code, &#8220;ren&#8217;s&#8221; didL<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/039ad2679a30659375feff6e358e5211?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1984778<br \/>\njquery-ui ember.js<br \/>\nI need an advanced multiselect element (with search function) for my ember application.I like this jQuery-UI Multiselect widget and started with this code:\/\/ app.js &#8230; App.MultiSelectView = Em.View.extend({didInsertElement: function() {this._super();console.log(&#8220;Creating multiSelect element&#8221;);$(&#8220;#mselect&#8221;).multiselect().multiselectfilter();}, }); App.multiSelectView = App.MultiSelectView.create(); &#8230;\/\/ index.html &#8230; &lt;script type=&#8221;text\/x-handlebars&#8221; data-template-name=&#8221;mulselect&#8221;&gt;&lt;sel<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/616a6715ea64187955126b3dd7b45736?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndgbonomo<br \/>\nember.js<br \/>\n(This is a double-post of my identical question on the EmberJS Discuss forums.)When a handlebars template {{value}} is somewhere where the browser doesn&#8217;t reasonably expect plain text, such as a &lt;table&gt;, it seems to behave in unexpected ways. I&#8217;ve created an example page with source and included it below. Can anybody explain what is going on or why this happening, and whether or not this behavior is intentional?To clarify, I&#8217;m not looking for a quick way around this. I know how to do that<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2f90e858672c079741471f72cba5480c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen<br \/>\nember.js state-management<br \/>\nI&#8217;ve setup a State Manager for tracking user login state, based on this answer here: Change Navbar based on login stateHowever, I&#8217;d like to take it to the next step and have not only the navbar update according to the state, but the main template itself. I&#8217;ve gotten this mostly working so that when you click on the login button it will show you the &#8216;welcome you&#8217;re now logged in message.&#8217; However, if you logout and try to login again, it just shows a blank screen as if it is not correctly re-re<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/30a5a82d73ac22f2eeec25008506d7d8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHaoQi Li<br \/>\nember.js ember-data<br \/>\nGeneral question: I would like to get an overview of current transaction (currentTransaction) and default transaction (defaultTransaction).Specific question: I&#8217;ve been comparing in the Ember controller this.get(&#8216;model&#8217;).save() and this.get(&#8216;store&#8217;).commit().this.get(&#8216;model&#8217;).save() will eventually call Ember-data Store&#8217;s get(this, &#8216;currentTransaction&#8217;).commit()., see github.this.get(&#8216;store&#8217;).commit() will eventually call Ember-data Store&#8217;s get(this, &#8216;defaultTransaction&#8217;).commit(), see github.In<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/785a8c350db7560d6f44eba003661ade?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWojciech Bednarski<br \/>\njavascript ember.js<br \/>\nI&#8217;m trying to call view method from controller, but no idea how to do this. From view I can easily call controller method like this.get(&#8216;controller&#8217;).send(&#8216;method&#8217;);How to do something like that from controller this.get(&#8216;view&#8217;).send(&#8216;method&#8217;);?To give you better overview what I&#8217;m trying to do.I have application controller Ember.Controller.extend({}) I have application view Ember.View.extend({}) and application template.In application template is login form, when user submit it controller method<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2e397793748ad025408645a3b6b99740?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJarrod Nettles<br \/>\nember.js url-routing client-side javascript-framework<br \/>\nI&#8217;m working on a new client-side only app with the latest version of Ember.js. There is a single PHP page which builds the scripts, css, template files, etc. and delivers it all into index.php. I&#8217;m using an htaccess directive so that all requests are rewritten to \/index.php. The PHP is only there to conveniently package the Javascript, as far as I&#8217;m concerned.Currently, routes in the browser look like this and work just fine.\/#\/about \/#\/favorites \/#\/etc \/#\/posts\/5\/editHowever, I would like them<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ken ember.js In the debugger it&#8217;s easy enough to get at the class definitions of objects I&#8217;ve created by typing in the App.ClassName.prototype. Ok not hugely interesting but still good when you&#8217;re first feeling around in the &#8220;Ember dark&#8221;. What about instances though? That&#8217;s really what I want access to. If my app has moved [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3426","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3426"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3426\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}