Skip to content

Instantly share code, notes, and snippets.

@ChristopheBelpaire
Last active August 29, 2015 14:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ChristopheBelpaire/8c56b237cd81b257dedb to your computer and use it in GitHub Desktop.
Router problem
I have :
Router.map(function() {
this.resource('dashboards', { path: '/' }, function() {
this.resource('dashboardsEdit', {path: ':id'}, function() {
this.route('newWidget', {path: 'new'});
});
});
});
var DashboardsRoute = Ember.Route.extend({
model: function() {
return this.store.find('dashboard');
}
});
<div class="tabbable">
<ul class="nav nav-tabs tab-bricky">
{{#each dashboard in controller}}
<li>
{{#link-to 'dashboardsEdit' dashboard}} {{dashboard.title}} {{/link-to}}
</li>
{{/each}}
</ul>
</div>
{{outlet}}
var DashboardsEdit = Ember.Route.extend({
model: function(params) {
return this.store.find('dashboard', params.id);
}
});
<div style = "padding: 9px 9px;">
<div class="row">
<div class="col-lg-12 col-md-12">
{{#link-to 'dashboardsEdit.newWidget' controller class="btn btn-success btn-squared"}} Add a widget {{/link-to}}
</div>
</div>
<br />
<div class="row">
<div class ="sortable">
{{#each widget in controller.widgets}}
<div {{bind-attr data-id=widget.id}} class="col-sm-3 item" >
<div class="panel panel-default">
<div class="panel-heading">
{{widget.title}}
<div class="panel-tools">
<a class="btn btn-xs btn-link panel-collapse collapses" href="#">
</a>
<a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
<i class="fa fa-wrench"></i>
</a>
<a class="btn btn-xs btn-link panel-refresh" href="#">
<i class="fa fa-refresh"></i>
</a>
<button class="btn btn-xs btn-link panel-close" {{action 'delete' widget}}>
<i class="fa fa-times"></i>
</button>
</div>
</div>
<div class="panel-body">
<div class="flot-medium-container">
<div id="placeholder-h1" class="flot-placeholder"></div>
</div>
</div>
</div>
</div>
{{/each}}
</div>
</div>
</div>
{{outlet}}
and when I try to go on the newWidget route I have :
Error while loading route: RangeError: Maximum call stack size exceeded
at guidFor (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js)
at Object.Map.get (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:16501:16)
at Object.Binding._scheduleSync (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:20585:36)
at Object.Binding.fromDidChange (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:20575:10)
at sendEvent (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:15748:14)
at notifyObservers (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:16134:5)
at propertyDidChange (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:15979:3)
at chainsDidChange (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:16060:5)
at propertyDidChange (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:15978:3)
at contentPropertyDidChange (http://127.0.0.1:5556/static/ember-solidbot/dist/assets/vendor.js:26977:3) vendor.js:16672
Uncaught RangeError: Maximum call stack size exceeded vendor.js:15336
get vendor.js:15336
Ember.ObjectProxy.Ember.Object.extend.unknownProperty vendor.js:27079
get vendor.js:15337
Ember.ObjectProxy.Ember.Object.extend.unknownProperty vendor.js:27079
get vendor.js:15337
Ember.ObjectProxy.Ember.Object.extend.unknownProperty vendor.js:27079
get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment