5 Comments Already

commenter
January 25th, 2013 @11:10 pm  

One suggestion that I would have is that it might be nice to also support just passing the “url” option directly to the binding handler and defaulting to using $data for the model (the 4th argument to the “update” function is the same as $data).

Then, you would be able to reduce the syntax to data-bind=”route: ‘person_details’”. The binding handler would just have to recognize the options object with model/url vs. the url directly.

commenter
Aaron Said,
January 26th, 2013 @6:22 am  

Good suggestion Ryan. I kept changing how it worked last night and never looked for something like that.

commenter
Aaron Said,
January 26th, 2013 @8:49 am  

Changed the syntax to use the $data property. :)

commenter
January 26th, 2013 @10:29 am  

Nice! Looks good in the markup now.

Just an insignificant clarification that the 4th argument, “viewModel”, to the init/update functions is actually the same as bindingContext.$data. Despite the name, it is not the overall view model and is the data that was bound at that level. Many times I will use “data” for the argument name to make sure that it is not confusing.

commenter
Aaron Said,
January 26th, 2013 @10:46 am  

Good golly I’m a slow learner. Updated to use 4th parameter. I named it $data as a reminder to myself that it’s the same as the 5th parameter’s $data property. :)

Related Post

Please Leave Your Comments Below

Please Note: All comments are moderated, so it may take some time before your comment appears.