开发者

using bindAll in a constructor

i wanted to use _.bindAll(this) in a constructor.

unfortunately, i realized the prototype functions are not considered "own properties", so _.bindAll via _.funct开发者_高级运维ions won't find them.

is there another way to get at the prototype functions of "this" in a constructor functions?


You could use the dreaded for-in loop, since that iterates over prototype properties as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜