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

Mustache {{>key}} doesn't accept partials in options

$
0
0
I'm trying to pass references to partials in options, like this:
  1. var ctrlCarouselAndTiles = can.Control.extend({
  2. defaults: {
  3. viewMain:  path.scripts + 'templates/carouselandtiles.mustache',
  4. viewTiles: path.scripts + 'templates/tiles.mustache',
  5. viewCarousel: path.scripts + 'templates/slider.mustache'
  6. }
  7. },{
  8. init: function(element, options){
  9. var self = this;
  10. self.element.html(self.options.viewMain, {
  11. slides: self.options.slides, 
  12. tiles: self.options.tiles,
  13. viewTiles: self.options.viewTiles,
  14. viewCarousel: self.options.viewCarousel
  15. });
  16.       }
  17. })
but the {{>viewTiles}} or {{>viewCarousel}} doesn't uses the value of the option but the key name as it would be undefined, therefore it failes to render the partials. It works if I uses the path as >key but I need to use different partials in different cases.
I tried to define the view first as it is in the documentation but doesn't work either.

I guess I'm doing it wrong, but what?

Viewing all articles
Browse latest Browse all 3491

Trending Articles