用于指令绑定的量角器exactBinding

时间:2015-03-23 15:12:02

标签: angularjs protractor

使用量角器......我试图获得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'))

1 个答案:

答案 0 :(得分:1)

by.exactBinding以及by.binding只会查看具有ng-binding类(source)的元素。

在您的情况下,获取元素by.css

by.css("[sort-property=name]")