These are chat archives for canjs/canjs

9th
Mar 2016
dylanrtt
@dylanrtt
Mar 09 2016 00:02

You could still allow it to be passed in since it is available as the 1st argument to the get() function.

parameters: {
  get(lastSetValue) {
    if (lastSetValue) {
      return lastSetValue;
    }
    return this.attr('myRows');
  }
}

You could do some kind of merge in there as well

Gregg Roemhildt
@roemhildtg
Mar 09 2016 00:10
That's essentially what I'm trying to do with the {viewModel.myRows add} function but the event doesn't seem to fire. http://jsbin.com/wuwajugeru/1/edit?html,js,console,output
dylanrtt
@dylanrtt
Mar 09 2016 00:11
oh, my bad. it should be '{viewModel.myRows} add'. the {} part is the subject and after that is the event name
Gregg Roemhildt
@roemhildtg
Mar 09 2016 00:24
I think I'm close, http://jsbin.com/nufijipela/1/edit?js,console,output Although I'm not necessarily interested in rendering the JSON data, it should update in the template which isn't happening..I think I've got something wrong...
dylanrtt
@dylanrtt
Mar 09 2016 00:40
It might be a bug with #each for objects, but it doesn't update in the template even though it is actually updated
You should also make your default value for "parameters" a function that returns an object unless you want all instances of <my-component> to have the same value for it
Gregg Roemhildt
@roemhildtg
Mar 09 2016 20:12
@dylanrtt okay, I think it might be. And yes, value is now a function. Question, when you create an event listener like '{viewModel.myRows} change', can you also do that on a property that is type: 'number'? Or should it be type:'compute'?
dylanrtt
@dylanrtt
Mar 09 2016 20:14
@roemhildtg The subject of the event should be a map/list or compute. If you want to listen to changes to a field, then use '{map} field' where the event name is the field name.
Gregg Roemhildt
@roemhildtg
Mar 09 2016 20:15
Awesome. Thanks!
Thomas Sieverding
@Bajix
Mar 09 2016 22:52
Does StealJs just do a SystemJS trace for stache files, build, cache, reset config, and rebuild?