aboutsummaryrefslogtreecommitdiffstats
path: root/src/scenario
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenario')
-rw-r--r--src/scenario/Application.js12
-rw-r--r--src/scenario/angular.suffix12
2 files changed, 18 insertions, 6 deletions
diff --git a/src/scenario/Application.js b/src/scenario/Application.js
index 5e7b8370..ba6bbea7 100644
--- a/src/scenario/Application.js
+++ b/src/scenario/Application.js
@@ -90,11 +90,13 @@ angular.scenario.Application.prototype.executeAction = function(action) {
if (!$window.angular) {
return action.call(this, $window, _jQuery($window.document));
}
- var element = $window.angular.element($window.document);
- var $injector = element.inheritedData('$injector');
- $injector.invoke(null, function($browser){
- $browser.notifyWhenNoOutstandingRequests(function() {
- action.call(self, $window, _jQuery($window.document));
+ angularInit($window.document, function(element) {
+ element = $window.angular.element(element);
+ var $injector = element.inheritedData('$injector');
+ $injector.invoke(null, function($browser){
+ $browser.notifyWhenNoOutstandingRequests(function() {
+ action.call(self, $window, _jQuery($window.document));
+ });
});
});
};
diff --git a/src/scenario/angular.suffix b/src/scenario/angular.suffix
index a79fd270..c75c5cca 100644
--- a/src/scenario/angular.suffix
+++ b/src/scenario/angular.suffix
@@ -1,7 +1,17 @@
+bindJQuery();
publishExternalAPI(angular);
var $runner = new angular.scenario.Runner(window),
- config = angularJsConfig(document);
+ 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) {
jqLiteWrap(document).ready(function() {