Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Unable to set desired context using mustache #with

$
0
0
First of all, thanks for a great framework.

I have a use case when using #with helper with a nested can.Map. My data passed in to the view is in the form:

var data = { map : new can.Map({a : {b : 'test' }}) };



I want to set the context to 'a' using the with-helper in the form of {{#with map.a}}. 

Unfortunately, there doesnt seem to be support for this. There's no mention of being able to achieve this in the documentation, so I wouldn't consider it a bug, but more of a feature request. If I use a plain object instead of a map, I'm able to set the correct context.

I put up a js fiddle to highlight the problem.




Viewing all articles
Browse latest Browse all 3491

Trending Articles