Skip to content

Instantly share code, notes, and snippets.

@darthdeus
Forked from jackkitley/gist:4706392
Last active December 12, 2015 03:28
Show Gist options
  • Save darthdeus/4706568 to your computer and use it in GitHub Desktop.
Save darthdeus/4706568 to your computer and use it in GitHub Desktop.
{{#linkTo catalogue.item item}
App.Router.map(function() {
this.resource('catalogue', function() {
// this.route('index'); - this is automatic
this.route('search', { path: ':searchvalue' });
this.route('item', {path: '/view/:itemguid'});
});
});
App.CatalogueItemRoute = Ember.Route.extend({
model: function(params) {
return {itemguid: params.itemguid};
},
setupController: function(controller, model) {
controller.show(model); // why is this here?
console.log("GOT INTO CATALOGUE ITEM");
},
serialize: function(model) {
return {itemguid: Em.get(model, 'itemguid')}
}
});
<script type="text/x-handlebars" data-template-name="catalogue.item">
Some data
</script>
Message i get : "Transitioned into 'catalogue.item' " - but it NEVER switches to the template...
@jackkitley
Copy link

because this is a method i call to show the catalogue item data. (controller.show(model); // why is this here?).
i dont user ember data....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment