aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngScenario/angular.suffix
blob: 846dbe176b392684c53fc3f546a3ea13da30e1ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
bindJQuery();
publishExternalAPI(angular);

var $runner = new angular.scenario.Runner(window),
    scripts = document.getElementsByTagName('script'),
    script = scripts[scripts.length - 1],
    config = {};

angular.forEach(script.attributes, function(attr) {
  var match = attr.name.match(/ng[:\-](.*)/);
  if (match) {
    config[match[1]] = attr.value || true;
  }
});

if (config.autotest) {
  JQLite(document).ready(function() {
    angular.scenario.setUpAndRun(config);
  });
}
})(window, document);