这里是另一个指令的attrs $观察。:myApp.directive('focus', function () { return function (scope, element, attrs) { attrs.$observe('focus', function (newValue) { newValue === 'true' && element[0].focus(); }); } }); 请注意,插值的...