ember.js - Emberjs: controller and route not getting along -
the example represent best, suppose. so, have defined route model property, displays appropriate image, based on id in url. worked:
app.detailsroute = ember.route.extend({ model: function(params) { return app.images.find(params.image_id); } });
however, wanted add action and... when set controller, page did not have access model part. controller:
app.detailscontroller = ember.controller.extend({ savetoserver: function(){ //alert(json.stringify()); alert('hi'); } });
so @ time it's this: either model set , stuff gets displayed , controller doesn't work or controller works , model not. why happening?
Comments
Post a Comment