11/**
2- * @license AngularJS v0.10.6-5cdfe45a
2+ * @license AngularJS v0.10.6
33 * (c) 2010-2012 AngularJS http://angularjs.org
44 * License: MIT
55 */
@@ -929,6 +929,7 @@ function bindJQuery() {
929929 jqLite = jQuery ;
930930 extend ( jQuery . fn , {
931931 scope : JQLitePrototype . scope ,
932+ injector : JQLitePrototype . injector ,
932933 inheritedData : JQLitePrototype . inheritedData
933934 } ) ;
934935 JQLitePatchJQueryRemove ( 'remove' , true ) ;
@@ -981,40 +982,45 @@ function setupModuleLoader(window) {
981982 * @name angular.module
982983 * @description
983984 *
984- * The `angular.module` is a global place for registering angular modules. All modules
985- * (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
985+ * The `angular.module` is a global place for creating and registering Angular modules. All
986+ * modules (angular core or 3rd party) that should be available to an application must be
987+ * registered using this mechanism.
988+ *
986989 *
987990 * # Module
988991 *
989- * A module is a collocation of services, directives, filters, and configure information. Module is used to configure the,
990- * {@link angular.module.AUTO.$injector $injector}.
992+ * A module is a collocation of services, directives, filters, and configure information. Module
993+ * is used to configure the {@link angular.module.AUTO.$injector $injector}.
991994 *
992995 * <pre>
993996 * // Create a new module
994997 * var myModule = angular.module('myModule', []);
995998 *
996- * // configure a new service
999+ * // register a new service
9971000 * myModule.value('appName', 'MyCoolApp');
9981001 *
9991002 * // configure existing services inside initialization blocks.
1000- * myModule.init (function($locationProvider) {
1003+ * myModule.config (function($locationProvider) {
10011004 * // Configure existing providers
1002- * $locationProvider.hashPrefix = '!';
1005+ * $locationProvider.hashPrefix( '!') ;
10031006 * });
10041007 * </pre>
10051008 *
1006- * Then you can load your module like this:
1009+ * Then you can create an injector and load your modules like this:
10071010 *
10081011 * <pre>
10091012 * var injector = angular.injector(['ng', 'MyModule'])
10101013 * </pre>
10111014 *
1015+ * However it's more likely that you'll just use {@link angular.directive.ng:app ng:app} or
1016+ * {@link angular.bootstrap} to simplify this process for you.
1017+ *
10121018 * @param {!string } name The name of the module to create or retrieve.
10131019 * @param {Array.<string>= } requires If specified then new module is being created. If unspecified then the
10141020 * the module is being retrieved for further configuration.
1015- * @param {Function } initFn Option configuration function for the module. Same as
1016- * {@link angular.Module#init Module.init ()}.
1017- * @return { angular.Module }
1021+ * @param {Function } configFn Option configuration function for the module. Same as
1022+ * {@link angular.Module#config Module#config ()}.
1023+ * @returns { module } new module with the { @link angular.Module} api.
10181024 */
10191025 return function module ( name , requires , configFn ) {
10201026 if ( requires && modules . hasOwnProperty ( name ) ) {
@@ -1107,8 +1113,8 @@ function setupModuleLoader(window) {
11071113 * @ngdoc method
11081114 * @name angular.Module#config
11091115 * @methodOf angular.Module
1110- * @param {Function } initializationFn Execute this function on module load. Useful for
1111- * service configuration.
1116+ * @param {Function } configFn Execute this function on module load. Useful for service
1117+ * configuration.
11121118 * @description
11131119 * Use this method to register work which needs to be performed on module loading.
11141120 */
@@ -1121,7 +1127,8 @@ function setupModuleLoader(window) {
11211127 * @param {Function } initializationFn Execute this function after injector creation.
11221128 * Useful for application initialization.
11231129 * @description
1124- * Use this method to register work which needs to be performed on module loading.
1130+ * Use this method to register work which needs to be performed when the injector with
1131+ * with the current module is finished loading.
11251132 */
11261133 run : function ( block ) {
11271134 runBlocks . push ( block ) ;
@@ -1166,7 +1173,7 @@ function setupModuleLoader(window) {
11661173 * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11671174 */
11681175var version = {
1169- full : '0.10.6-5cdfe45a ' , // all of these placeholder strings will be replaced by rake's
1176+ full : '0.10.6' , // all of these placeholder strings will be replaced by rake's
11701177 major : 0 , // compile task
11711178 minor : 10 ,
11721179 dot : 6 ,
@@ -1525,7 +1532,7 @@ function inferInjectionArgs(fn) {
15251532 * <pre>
15261533 * var $injector = angular.injector();
15271534 * expect($injector.get('$injector')).toBe($injector);
1528- * expect($injector.invoke(null, function($injector){
1535+ * expect($injector.invoke(function($injector){
15291536 * return $injector;
15301537 * }).toBe($injector);
15311538 * </pre>
@@ -1632,21 +1639,21 @@ function inferInjectionArgs(fn) {
16321639 *
16331640 * describe('Greeter', function(){
16341641 *
1635- * beforeEach(inject (function($provide) {
1642+ * beforeEach(module (function($provide) {
16361643 * $provide.service('greet', GreetProvider);
16371644 * });
16381645 *
16391646 * it('should greet', inject(function(greet) {
16401647 * expect(greet('angular')).toEqual('Hello angular!');
16411648 * }));
16421649 *
1643- * it('should allow configuration of salutation', inject(
1644- * function(greetProvider) {
1650+ * it('should allow configuration of salutation', function() {
1651+ * module( function(greetProvider) {
16451652 * greetProvider.salutation('Ahoj');
1646- * },
1647- * function(greet) {
1653+ * });
1654+ * inject( function(greet) {
16481655 * expect(greet('angular')).toEqual('Ahoj angular!');
1649- * }
1656+ * });
16501657 * )};
16511658 *
16521659 * });
@@ -2392,6 +2399,8 @@ function htmlSanitizeWriter(buf){
23922399 * ## In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite:
23932400 *
23942401 * - `scope()` - retrieves the current Angular scope of the element.
2402+ * - `injector()` - retrieves the Angular injector associated with application that the element is
2403+ * part of.
23952404 * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
23962405 * parent element is reached.
23972406 *
@@ -2647,6 +2656,10 @@ forEach({
26472656 return jqLite ( element ) . inheritedData ( $$scope ) ;
26482657 } ,
26492658
2659+ injector : function ( element ) {
2660+ return jqLite ( element ) . inheritedData ( '$injector' ) ;
2661+ } ,
2662+
26502663 removeAttr : function ( element , name ) {
26512664 element . removeAttribute ( name ) ;
26522665 } ,
@@ -6335,13 +6348,13 @@ function $LocationProvider(){
63356348 hashPrefix = prefix ;
63366349 return this ;
63376350 } else {
6338- return html5Mode ;
6351+ return hashPrefix ;
63396352 }
63406353 }
63416354
63426355 /**
63436356 * @ngdoc property
6344- * @name angular.module.ng.$locationProvider#hashPrefix
6357+ * @name angular.module.ng.$locationProvider#html5Mode
63456358 * @methodOf angular.module.ng.$locationProvider
63466359 * @description
63476360 * @param {string= } mode Use HTML5 strategy if available.
@@ -6418,8 +6431,10 @@ function $LocationProvider(){
64186431 // update $location when $browser url changes
64196432 $browser . onUrlChange ( function ( newUrl ) {
64206433 if ( currentUrl . absUrl ( ) != newUrl ) {
6421- currentUrl . $$parse ( newUrl ) ;
6422- $rootScope . $apply ( ) ;
6434+ $rootScope . $evalAsync ( function ( ) {
6435+ currentUrl . $$parse ( newUrl ) ;
6436+ } ) ;
6437+ if ( ! $rootScope . $$phase ) $rootScope . $digest ( ) ;
64236438 }
64246439 } ) ;
64256440
@@ -6581,8 +6596,8 @@ function $LogProvider(){
65816596 * @param {Object.<Object>= } actions Hash with declaration of custom action that should extend the
65826597 * default set of resource actions. The declaration should be created in the following format:
65836598 *
6584- * {action1: {method:?, params:?, isArray:?, verifyCache:? },
6585- * action2: {method:?, params:?, isArray:?, verifyCache:? },
6599+ * {action1: {method:?, params:?, isArray:?},
6600+ * action2: {method:?, params:?, isArray:?},
65866601 * ...}
65876602 *
65886603 * Where:
@@ -6594,9 +6609,6 @@ function $LogProvider(){
65946609 * - `params` – {object=} – Optional set of pre-bound parameters for this action.
65956610 * - isArray – {boolean=} – If true then the returned object for this action is an array, see
65966611 * `returns` section.
6597- * - verifyCache – {boolean=} – If true then whenever cache hit occurs, the object is returned and
6598- * an async request will be made to the server and the resources as well as the cache will be
6599- * updated when the response is received.
66006612 *
66016613 * @returns {Object } A resource "class" object with methods for the default set of resource actions
66026614 * optionally extended with custom `actions`. The default set contains these actions:
@@ -8453,7 +8465,8 @@ function $RootScopeProvider(){
84538465 *
84548466 * # Example
84558467 <pre>
8456- var scope = angular.module.ng.$rootScope.Scope();
8468+ // let's assume that scope was dependency injected as the $rootScope
8469+ var scope = $rootScope;
84578470 scope.name = 'misko';
84588471 scope.counter = 0;
84598472
@@ -9980,7 +9993,8 @@ angularDirective("ng:init", function(expression){
99809993 this.contacts.push({type:'email', value:'yourname@example .org'});
99819994 },
99829995 removeContact: function(contactToRemove) {
9983- angular.module.ng.$filter.remove(this.contacts, contactToRemove);
9996+ var index = this.contacts.indexOf(contactToRemove);
9997+ this.contacts.splice(index, 1);
99849998 },
99859999 clearContact: function(contact) {
998610000 contact.type = 'phone';
0 commit comments