Last active
August 29, 2015 14:04
-
-
Save plasticut/f0eb4fe7b89f936abbac to your computer and use it in GitHub Desktop.
get model from element context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comp.prototype.onClick = function(ev, el) { | |
var item = this.model.root.at(el.$bindStart.context.expression.pathSegments(el.$bindStart.context).join('.')); | |
}; | |
//// | |
app.on('model', function(model) { | |
model.fromEl = function(el) { | |
var ctx = el.$bindStart.context; | |
return this.at(ctx.expression.pathSegments(ctx).join('.')); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment