且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AngularJS 自定义指令双向绑定

更新时间:2021-08-20 02:46:10

为什么隔离作用域是矫枉过正?它对这种事情非常有用:

Why is an isolate scope overkill? its pretty useful for exactly this kind of thing:

  scope: {
     "twoway": "=" // two way binding
  },

对于这个问题,这是一个非常惯用的角度解决方案,所以这就是我要坚持的.

This is a pretty idiomatic angular solution to this problem, so this is what I'd stick with.