'{scope.promise} change’: function () { … }
. change
events in CanJS are not the same as in other libraries.
change
means that some property on an entire object has changed.
var map = new can.Map({ foo: ‘bar’, boo: ‘baz’ });
map.bind(‘change’, function () { console.log(‘!!!’) });
map.attr(‘foo’, ‘baz’); //-> !!!
map.attr(‘boo’, ‘bar’); //-> !!!
var map = new can.Map({ foo: ‘bar’, boo: ‘baz’ });
map.bind(‘boo’, function () { console.log(‘!!!’) });
map.attr(‘foo’, ‘baz’); //->
map.attr(‘boo’, ‘bar’); //-> !!!
‘{scope} promise’: function () { … }
change
events have a lot of overhead. For performance reasons they should be avoided when possible.
promise
is dependent on state
, it causes a loop.
it seems the promise's call to attr('state', state)
sets up a dependency if i'm not mistaken, anyway.
if you could fix the jsbin to work without binding a noop handler to work correctly i.e.
state
when promise
changes and when resolved/rejectedpromise
if idKey
changesmodel
when promise
resolvesthat would grant me a good night sleep!
idKey
setter kind of defeats the purpose of observables, after all, idKey
shouldn't have to know what depends on it at all. i'll call it a day. again thanks for your time and efforts! hope to see you around here soon.
{{#each}}
helper: http://jsbin.com/warebexisa/edit?html,js,output
fade-in-when="{prop}"
attribute. you could probably apply the same principle to other animationsleakScope: false
anywhere so let me double check and see why the child was not inheriting from the parent scope. I did just notice that my isLoggedIn was set as a variable on the parent scope and not as a function - maybe that's it? I'll find out. At least knowing that child components should inherit their parent scopes is all I need - I'm sure I'm doing something else wrong then. Thanks again!