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

Re : can.route.map - working with arrays

$
0
0
http://jsfiddle.net/moschel/dQzA6/5/

I made your example work the way you expected it to.  You had several things wrong that needed to be corrected to at least make the fiddle run correctly.  You were using EJS, but that's deprecated and not part of core anymore.  Also you didn't include the map/define plugin, so I did that too.

You can't have a value: function(){return new can.List()} for locationIds, beacuse locationIds is supposed to be a "virtual" property that doesn't actually contain any real value, its just used for serializing.  Once you give it a value property it becomes a real value, not a virtual one.

After you remove the last item in the list, you'll see 'locations' contains an empty array. I believe this was working mostly correctly all along but you had these other issues hiding that.  Please let me know if this solves your problem.

Thanks,
Brian

Viewing all articles
Browse latest Browse all 3491

Trending Articles