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

Passing Parameters To can.Component's Scope

$
0
0
The following works by setting myObject to the value of someObject
  1. $("#dummy").append(can.view.mustache("<dummy-tag myObject='{{.}}'></dummy-tag>")(someObject);

But what if I wanted to pass in multiple objects. I thought this might work, but it does not.
  1. $("#dummy").append(can.view.mustache("<dummy-tag myObject='{{myObject}}' thing='{{thing}}'></dummy-tag>")({
        myObject: someObject,
        thing: myThing
    }));

Is it not possible to pass in multiple objects? Do I just have to do something like this and grab the objects off of scope.data?
  1. $("#dummy").append(can.view.mustache("<dummy-tag data='{{.}}'></dummy-tag>")({
        thing: thing,
        games: games
    }));

Viewing all articles
Browse latest Browse all 3491

Trending Articles