These are chat archives for canjs/canjs

6th
Oct 2015
Matthew Phillips
@matthewp
Oct 06 2015 01:22
@justinbmeyer <form ($submit)="doSearch()">
this inside of doSearch() is the window
this is a bug, right?
scopeData.parent is undefined
It doesn't look like scope.read every return a parent property
Maybe this should be scopeData.scope._parent
Matthew Phillips
@matthewp
Oct 06 2015 01:29
I don't think that's right either
in my case scopeData.scope._context is the component's viewModel
which is what should be this
bitovi/canjs#1970
Josh Dean
@imjoshdean
Oct 06 2015 16:12
Hey, this got brought up at some point before, but I was curious about it...
For the created event, as well as I assume updated and destroyed, it looks like they fire on .save() and .destroyed()
Is there any particular reason they aren't fired on the static model functions? e.g. create, update, destroy?
In this example I would expect to see "created called" in the console twice. http://jsbin.com/xebabizagu/edit?html,js,console
David Luecke
@daffl
Oct 06 2015 16:15
Those static functions are not supposed to be called directly
Josh Dean
@imjoshdean
Oct 06 2015 16:16
:|
that emoticon doesn't properly convey what I was going for...
David Luecke
@daffl
Oct 06 2015 16:18

Well the docs say that the events are only triggered on the prototype functions. E.g. in http://canjs.com/docs/can.Model.prototype.destroy.html

This triggers "destroyed" events on the instance and the Model constructor function which can be listened to with bind and bind.

Where the static docs state

destroy(id) -> Deferred is used by destroy remove a model instance from the server.

Josh Dean
@imjoshdean
Oct 06 2015 16:22
Word, thanks.