@@ -125,23 +125,24 @@ function create_refresher(type, expr, element, currentValue, attrName, ctr) {
125
125
126
126
127
127
function bind ( current , expr , model , ctx , element , ctr , attrName , type ) {
128
+ let owner = type === 'compo-attr' || type === 'compo-prop' ? ctr . parent : ctr ;
128
129
var refresher = create_refresher ( type , expr , element , current , attrName , ctr ) ,
129
- binder = expression_createBinder ( expr , model , ctx , ctr , refresher ) ;
130
+ binder = expression_createBinder ( expr , model , ctx , owner , refresher ) ;
130
131
131
- expression_bind ( expr , model , ctx , ctr , binder ) ;
132
+ expression_bind ( expr , model , ctx , owner , binder ) ;
132
133
133
134
Component . attach ( ctr , 'dispose' , function ( ) {
134
- expression_unbind ( expr , model , ctr , binder ) ;
135
+ expression_unbind ( expr , model , owner , binder ) ;
135
136
} ) ;
136
137
}
137
138
138
139
customUtil_register ( 'bind' , {
139
140
mode : 'partial' ,
140
141
current : null ,
141
142
element : null ,
142
- nodeRenderStart : function ( expr , model , ctx , el , ctr , type , node ) {
143
-
144
- var current = expression_eval_safe ( expr , model , ctx , ctr , node ) ;
143
+ nodeRenderStart : function ( expr , model , ctx , el , ctr , attrName , type , node ) {
144
+ let owner = type === 'compo-attr' || type === 'compo-prop' ? ctr . parent : ctr ;
145
+ let current = expression_eval_safe ( expr , model , ctx , owner , node ) ;
145
146
146
147
// though we apply value's to `this` context, but it is only for immediat use
147
148
// in .node() function, as `this` context is a static object that share all bind
@@ -168,8 +169,9 @@ customUtil_register('bind', {
168
169
return el ;
169
170
} ,
170
171
171
- attrRenderStart : function ( expr , model , ctx , el , ctr , type , node ) {
172
- return ( this . current = expression_eval_safe ( expr , model , ctx , ctr , node ) ) ;
172
+ attrRenderStart : function ( expr , model , ctx , el , ctr , attrName , type , node ) {
173
+ let owner = type === 'compo-attr' || type === 'compo-prop' ? ctr . parent : ctr ;
174
+ return ( this . current = expression_eval_safe ( expr , model , ctx , owner , node ) ) ;
173
175
} ,
174
176
attr : function ( expr , model , ctx , element , controller , attrName , type ) {
175
177
bind (
0 commit comments