使用量角器......我试图获得sort-property='name'
的绑定。我遇到的问题是exactBinding
找不到它。如何才能使exactBinding
抓住这个绑定?
.directive('rxSortableColumn', function () {
return {
restrict: 'E',
templateUrl: 'templates/rxSortableColumn.html',
transclude: true,
scope: {
sortMethod: '&',
sortProperty: '@',
predicate: '=',
reverse: '='
}
};
})
<rx-sortable-column sort-property="name" predicate="sort.predicate" reverse="sort.reverse" class="ng-isolate-scope"></rx-sortable-column>
element.all(By.exactBinding('name'))
答案 0 :(得分:1)
by.exactBinding
以及by.binding
只会查看具有ng-binding
类(source)的元素。
在您的情况下,获取元素by.css
:
by.css("[sort-property=name]")