使用语法时,如何通过Model.bindOne()将角度数据模型绑定到范围?controller as
如果我注入,这将有效$scope
:
MyModel.bindOne( $scope, 'myModel', myId ); // Works as expected
但是在使用时controller as
,我几乎希望能够执行以下操作:
MyModel.bindOne( this, 'myModel', myId ); // TypeError: undefined is not a function