} */
+ var modules = {};
+
+ /**
+ * @ngdoc function
+ * @name angular.module
+ * @description
+ *
+ * The `angular.module` is a global place for registering angular modules. All modules
+ * (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
+ *
+ * # Module
+ *
+ * A module is a collocation of services, directives, filters, and configure information. Module is used to configure the,
+ * {@link angular.module.AUTO.$injector $injector}.
+ *
+ *
+ * // Create a new module
+ * var myModule = angular.module('myModule', []);
+ *
+ * // configure a new service
+ * myModule.value('appName', 'MyCoolApp');
+ *
+ * // configure existing services inside initialization blocks.
+ * myModule.init(function($locationProvider) {
+ * // Configure existing providers
+ * $locationProvider.hashPrefix = '!';
+ * });
+ *
+ *
+ * Then you can load your module like this:
+ *
+ *
+ * var injector = angular.injector('ng', 'MyModule')
+ *
+ *
+ * @param {!string} name The name of the module to create or retrieve.
+ * @param {Array.=} requires If specified then new module is being created. If unspecified then the
+ * the module is being retrieved for further configuration.
+ * @param {Function} initFn Option configuration function for the module. Same as
+ * {@link angular.Module#init Module.init()}.
+ * @return {angular.Module}
+ */
+ return function module(name, requires, initFn) {
+ if (requires && modules.hasOwnProperty(name)) {
+ modules[name] = null;
+ }
+ return ensure(modules, name, function() {
+ if (!requires) {
+ throw Error('No module: ' + name);
+ }
+
+ function init(fn) {
+ invokeQueue.push(['$injector', 'invoke', [null, fn]]);
+ }
+
+ /** @type {!Array.>} */
+ var invokeQueue = [];
+
+ /** @type {angular.Module} */
+ var moduleInstance = {
+ /**
+ * @ngdoc property
+ * @name angular.Module#requires
+ * @propertyOf angular.Module
+ * @returns {Array.} List of module names which must be loaded before this module.
+ * @description
+ * Holds the list of modules which the injector will load before the current module is loaded.
+ */
+ requires: requires,
+ invokeQueue: invokeQueue,
+
+ /**
+ * @ngdoc method
+ * @name angular.Module#service
+ * @methodOf angular.Module
+ * @param {string} name service name
+ * @param {Function} providerType Construction function for creating new instance of the service.
+ * @description
+ * See {@link angular.module.AUTO.$provide#service $provide.service()}.
+ */
+ service: invokeLater('$provide', 'service'),
+
+ /**
+ * @ngdoc method
+ * @name angular.Module#factory
+ * @methodOf angular.Module
+ * @param {string} name service name
+ * @param {Function} providerFunction Function for creating new instance of the service.
+ * @description
+ * See {@link angular.module.AUTO.$provide#service $provide.factory()}.
+ */
+ factory: invokeLater('$provide', 'factory'),
+
+ /**
+ * @ngdoc method
+ * @name angular.Module#value
+ * @methodOf angular.Module
+ * @param {string} name service name
+ * @param {*} object Service instance object.
+ * @description
+ * See {@link angular.module.AUTO.$provide#value $provide.value()}.
+ */
+ value: invokeLater('$provide', 'value'),
+
+ /**
+ * @ngdoc method
+ * @name angular.Module#filter
+ * @methodOf angular.Module
+ * @param {string} name filterr name
+ * @param {Function} filterFactory Factory function for creating new instance of filter.
+ * @description
+ * See {@link angular.module.ng.$filterProvider#register $filterProvider.register()}.
+ */
+ filter: invokeLater('$filterProvider', 'register'),
+
+ /**
+ * @ngdoc method
+ * @name angular.Module#init
+ * @methodOf angular.Module
+ * @param {Function} initializationFn Execute this function on module load, allowing it to do any
+ * service configuration..
+ * @description
+ * Use this method to register work which needs to be performed on module loading.
+ */
+ init: init
+ };
+
+ if (initFn) {
+ init(initFn);
+ }
+
+ return moduleInstance;
+
+ /**
+ * @param {string} provider
+ * @param {string} method
+ * @returns {angular.Module}
+ */
+ function invokeLater(provider, method) {
+ return function() {
+ invokeQueue.push([provider, method, arguments]);
+ return moduleInstance;
+ }
+ }
+ });
+ };
+ });
+
+}
diff --git a/src/loader.prefix b/src/loader.prefix
new file mode 100644
index 00000000..b3969eb0
--- /dev/null
+++ b/src/loader.prefix
@@ -0,0 +1,7 @@
+/**
+ * @license AngularJS v"NG_VERSION_FULL"
+ * (c) 2010-2012 AngularJS http://angularjs.org
+ * License: MIT
+ */
+'use strict';
+(
diff --git a/src/loader.suffix b/src/loader.suffix
new file mode 100644
index 00000000..b8a5d43d
--- /dev/null
+++ b/src/loader.suffix
@@ -0,0 +1,20 @@
+)(window);
+
+/**
+ * Closure compiler type information
+ *
+ * @typedef { {
+ * requires: !Array.,
+ * invokeQueue: !Array.>,
+ *
+ * service: function(string, Function):angular.Module,
+ * factory: function(string, Function):angular.Module,
+ * value: function(string, *):angular.Module,
+ *
+ * filter: function(string, Function):angular.Module,
+ *
+ * init: function(Function):angular.Module
+ * } }
+ */
+angular.Module;
+
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() {
--
cgit v1.2.3