mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix(scenario-runner): support data-ng and x-ng based attributes
Prefixed attributes like data-ng-model and x-ng-model were not being found by the Selector. It was only looking at ng: and ng- prefixed attributes. Added a few tests as well to ensure the aforementioned prefixed attributes are being matched properly. Closes #1020
This commit is contained in:
@@ -119,7 +119,9 @@ angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior,
|
||||
});
|
||||
var result = $document.find(selector);
|
||||
if (selector.match(NG)) {
|
||||
result = result.add(selector.replace(NG, '[ng-'), $document);
|
||||
angular.forEach(['[ng-','[data-ng-','[x-ng-'], function(value, index){
|
||||
result = result.add(selector.replace(NG, value), $document);
|
||||
});
|
||||
}
|
||||
if (!result.length) {
|
||||
throw {
|
||||
|
||||
Reference in New Issue
Block a user