Isolate Scope “=” binding and doted notation AngularJS
问题 How do you create a 2 way binding with a nested property in an isolate scope with dotted notation. I thought 'myObject.data': "=data" would work, but it does not. I don't want to link everything in the myObject object. I know I could do some sort of watch, but 'myObject.data' seems cleaner. .directive("myDirective", [function() { return { restrict: "E", scope: { 'myObject.data': "=data" }, link: function (scope, element, attrs) { scope.myObject = { data: "myValue" }; } }; }]) 回答1: Isolated