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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -