Thursday, 15 May 2014

ember.js - Attempted to register a view with an id already in use -



ember.js - Attempted to register a view with an id already in use -

since commit can't registrer view id twice. seems logical. got issue.

router

app.router.map(function() { this.resource('contact', { path: '/contacts/:contact_id' }); }); app.contactshowroute = ember.route.extend({});

view

app.contactshowview = em.view.extend({ elementid: "page-show-contact" });

consider i'm on route app.contactshowroute. transitionto() same route different context.

i expected emberjs destroy view , create again, got next error:

class="lang-js prettyprint-override">uncaught error: assertion failed: attempted register view id in use: page-show-contact

i don't want instantiate view same id twice. want ember destroy actual 1 , create new one.

it seems bug in current version. maybe should open ticket. until fixed, might help:

app.contactshowroute = ember.route.extend({ rendertemplate : function(controller, model) { if(this.lastrenderedtemplate == this.routename) return; homecoming this._super(); } });

ember.js

No comments:

Post a Comment