type: "*"
can-connect
to load non-observable plain JS data
If you just pass a PJSO into can.view, it’s the same as constructing a can.Map
-> that's not accurate
can.Map
and there's no event binding.
can.stache("<h1>{{message}}</h1>")({message: "HI"})
<h1>Hi</h1>
{message: "HI"}
into a map or anything
var data = {message: "HI"};
var frag = can.stache("<h1>{{message}}</h1>")(data):
data.message = "BYE";
frag //-> <h1>HI</h1>
var data = {message: "HI"};
var frag = can.stache("<foo-bar {(message)}="./message”/><h1>{{message}}</h1>")(data);
$(document.body).append(frag);
can.viewModel('foo-bar').attr('message', 'BYE');
frag //-> <h1>BYE</h1>
var data = can.observe({message: "HI"});
var frag = can.stache("<foo-bar {(message)}='./message'/><h1>{{message}}</h1>")(data);
$(document.body).append(frag);
can.viewModel('foo-bar').message="bye";
.attr
for all these years if we had a good way of making POJO's observable
.attr
and some without to limit the number of observables read
myMap.define.foo.get = () => { ... }
, and something observing it, like myMap.attr('foo')
-- I don't understand the can compute implementation very well, but could that getter function ever be called before myMap.attr('foo')
is evaluated?
myMap.define.foo.get
to have side effects? Are they expected to be idempotent?
attr
or computes read during a getter or helper will be tracked, and bound to, which is how it knows to re-compute.
I again need help.
can.fixture("/modules/page.tournament/tournament-leaderboard-new/data/stracka/leaderboard-cgo-v2.json",
"/modules/page.tournament/tournament-leaderboard-new/data/leaderboard-canjs" + counters.leaderboard++ + "-v2.json");
I know the fixture is being loaded and I know that the can.ajax request url matches, but I am not getting the file I expected.
can.fixture("/modules/page.tournament/tournament-leaderboard-new/data/stracka/leaderboard-cgo-v2.json?ts={ts}”, …);
can.debounceBatch
that’s equivalent of can.debounce
+ can.batch.afterPreviousEvents
. I think we can use that as a helper for making less noisy getters