diff options
| author | Peter Bacon Darwin | 2014-02-26 11:46:02 +0000 |
|---|---|---|
| committer | Peter Bacon Darwin | 2014-02-26 11:47:22 +0000 |
| commit | 332e935048d161764046b43fe6599e1db2afc3b6 (patch) | |
| tree | e560b374b78b75e9bf27d67dbf8d5f2de6598f2d /src | |
| parent | 30c8207e0f2e10a6f02a0c2ba16825ad27092108 (diff) | |
| download | angular.js-332e935048d161764046b43fe6599e1db2afc3b6.tar.bz2 | |
docs(*): fix jsdoc type expressions
These errors in the docs were preventing some parts of the docs from being
parsed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 12 | ||||
| -rw-r--r-- | src/apis.js | 2 | ||||
| -rw-r--r-- | src/auto/injector.js | 6 | ||||
| -rw-r--r-- | src/minErr.js | 2 | ||||
| -rw-r--r-- | src/ng/animate.js | 14 | ||||
| -rw-r--r-- | src/ng/browser.js | 2 | ||||
| -rw-r--r-- | src/ng/compile.js | 16 | ||||
| -rw-r--r-- | src/ng/filter.js | 2 | ||||
| -rw-r--r-- | src/ng/http.js | 2 | ||||
| -rw-r--r-- | src/ng/interval.js | 174 | ||||
| -rw-r--r-- | src/ng/q.js | 2 | ||||
| -rw-r--r-- | src/ng/rootScope.js | 2 | ||||
| -rw-r--r-- | src/ngAnimate/animate.js | 4 | ||||
| -rw-r--r-- | src/ngRoute/route.js | 4 | ||||
| -rw-r--r-- | src/ngSanitize/sanitize.js | 2 |
15 files changed, 123 insertions, 123 deletions
diff --git a/src/Angular.js b/src/Angular.js index f1ed847f..bc2ecf94 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -289,7 +289,7 @@ function reverseParams(iteratorFn) { * the number string gets longer over time, and it can also overflow, where as the nextId * will grow much slower, it is a string, and it will never overflow. * - * @returns an unique alpha-numeric string + * @returns {string} an unique alpha-numeric string */ function nextUid() { var index = uid.length; @@ -1053,7 +1053,7 @@ function tryDecodeURIComponent(value) { /** * Parses an escaped url query string into key-value pairs. - * @returns Object.<(string|boolean)> + * @returns {Object.<string,boolean|Array>} */ function parseKeyValue(/**string*/keyValue) { var obj = {}, key_value, key; @@ -1349,9 +1349,9 @@ function assertNotHasOwnProperty(name, context) { /** * Return the value accessible from the object by path. Any undefined traversals are ignored * @param {Object} obj starting object - * @param {string} path path to traverse - * @param {boolean=true} bindFnToScope - * @returns value as accessible by path + * @param {String} path path to traverse + * @param {boolean} [bindFnToScope=true] + * @returns {Object} value as accessible by path */ //TODO(misko): this function needs to be removed function getter(obj, path, bindFnToScope) { @@ -1376,7 +1376,7 @@ function getter(obj, path, bindFnToScope) { /** * Return the DOM siblings between the first and last node in the given array. * @param {Array} array like object - * @returns jQlite object containing the elements + * @returns {DOMElement} object containing the elements */ function getBlockElements(nodes) { var startNode = nodes[0], diff --git a/src/apis.js b/src/apis.js index c5d2b3d3..a6df5811 100644 --- a/src/apis.js +++ b/src/apis.js @@ -49,7 +49,7 @@ HashMap.prototype = { /** * @param key - * @returns the value for the key + * @returns {Object} the value for the key */ get: function(key) { return this[hashKey(key)]; diff --git a/src/auto/injector.js b/src/auto/injector.js index a4fa35e8..f71c7b30 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -168,7 +168,7 @@ function annotate(fn) { * @description * Invoke the method and supply the method arguments from the `$injector`. * - * @param {!function} fn The function to invoke. Function parameters are injected according to the + * @param {!Function} fn The function to invoke. Function parameters are injected according to the * {@link guide/di $inject Annotation} rules. * @param {Object=} self The `this` for the invoked method. * @param {Object=} locals Optional object. If preset then any argument names are read from this @@ -195,7 +195,7 @@ function annotate(fn) { * operator and supplies all of the arguments to the constructor function as specified by the * constructor annotation. * - * @param {function} Type Annotated constructor function. + * @param {Function} Type Annotated constructor function. * @param {Object=} locals Optional object. If preset then any argument names are read from this * object first, before the `$injector` is consulted. * @returns {Object} new instance of `Type`. @@ -275,7 +275,7 @@ function annotate(fn) { * ).toEqual(['$compile', '$rootScope']); * ``` * - * @param {function|Array.<string|Function>} fn Function for which dependent service names need to + * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to * be retrieved as described above. * * @returns {Array.<string>} The names of the services which the function requires. diff --git a/src/minErr.js b/src/minErr.js index e42a0817..7df5fdff 100644 --- a/src/minErr.js +++ b/src/minErr.js @@ -25,7 +25,7 @@ * should all be static strings, not variables or general expressions. * * @param {string} module The namespace to use for the new minErr instance. - * @returns {function(string, string, ...): Error} instance + * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance */ function minErr(module) { diff --git a/src/ng/animate.js b/src/ng/animate.js index d90f086b..785d1dfa 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -49,7 +49,7 @@ var $AnimateProvider = ['$provide', function($provide) { * ``` * * @param {string} name The name of the animation. - * @param {function} factory The factory function that will be executed to return the animation + * @param {Function} factory The factory function that will be executed to return the animation * object. */ this.register = function(name, factory) { @@ -118,7 +118,7 @@ var $AnimateProvider = ['$provide', function($provide) { * a child (if the after element is not present) * @param {DOMElement} after the sibling element which will append the element * after itself - * @param {function=} done callback function that will be called after the element has been + * @param {Function=} done callback function that will be called after the element has been * inserted into the DOM */ enter : function(element, parent, after, done) { @@ -141,7 +141,7 @@ var $AnimateProvider = ['$provide', function($provide) { * @description Removes the element from the DOM. Once complete, the done() callback will be * fired (if provided). * @param {DOMElement} element the element which will be removed from the DOM - * @param {function=} done callback function that will be called after the element has been + * @param {Function=} done callback function that will be called after the element has been * removed from the DOM */ leave : function(element, done) { @@ -164,7 +164,7 @@ var $AnimateProvider = ['$provide', function($provide) { * inserted into (if the after element is not present) * @param {DOMElement} after the sibling element where the element will be * positioned next to - * @param {function=} done the callback function (if provided) that will be fired after the + * @param {Function=} done the callback function (if provided) that will be fired after the * element has been moved to its new position */ move : function(element, parent, after, done) { @@ -183,7 +183,7 @@ var $AnimateProvider = ['$provide', function($provide) { * @param {DOMElement} element the element which will have the className value * added to it * @param {string} className the CSS class which will be added to the element - * @param {function=} done the callback function (if provided) that will be fired after the + * @param {Function=} done the callback function (if provided) that will be fired after the * className value has been added to the element */ addClass : function(element, className, done) { @@ -206,7 +206,7 @@ var $AnimateProvider = ['$provide', function($provide) { * @param {DOMElement} element the element which will have the className value * removed from it * @param {string} className the CSS class which will be removed from the element - * @param {function=} done the callback function (if provided) that will be fired after the + * @param {Function=} done the callback function (if provided) that will be fired after the * className value has been removed from the element */ removeClass : function(element, className, done) { @@ -230,7 +230,7 @@ var $AnimateProvider = ['$provide', function($provide) { * removed from it * @param {string} add the CSS classes which will be added to the element * @param {string} remove the CSS class which will be removed from the element - * @param {function=} done the callback function (if provided) that will be fired after the + * @param {Function=} done the callback function (if provided) that will be fired after the * CSS classes have been set on the element */ setClass : function(element, add, remove, done) { diff --git a/src/ng/browser.js b/src/ng/browser.js index 52a0b979..6bec5280 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -245,7 +245,7 @@ function Browser(window, document, $log, $sniffer) { * Returns current <base href> * (always relative - without domain) * - * @returns {string=} current <base href> + * @returns {string} The current base href */ self.baseHref = function() { var href = baseElement.attr('href'); diff --git a/src/ng/compile.js b/src/ng/compile.js index 0265beb4..13e79b24 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -440,10 +440,10 @@ * * * @param {string|DOMElement} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. + * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) - * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template + * @returns {function(scope, cloneAttachFn=)} a link function which is used to bind template * (a DOM element/tree) to a scope. Where: * * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. @@ -521,7 +521,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which * will match as <code>ng-bind</code>), or an object map of directives where the keys are the * names and the values are the factories. - * @param {function|Array} directiveFactory An injectable directive factory function. See + * @param {Function|Array} directiveFactory An injectable directive factory function. See * {@link guide/directive} for more info. * @returns {ng.$compileProvider} Self for chaining. */ @@ -868,13 +868,13 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { * function, which is the a linking function for the node. * * @param {NodeList} nodeList an array of nodes or NodeList to compile - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then * the rootElement must be set the jqLite collection of the compile root. This is * needed so that the jqLite collection items can be replaced with widgets. * @param {number=} maxPriority Max directive priority. - * @returns {?function} A composite linking function of all of the matched directives or null. + * @returns {Function} A composite linking function of all of the matched directives or null. */ function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, previousCompileContext) { @@ -1118,7 +1118,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { * this needs to be pre-sorted by priority order. * @param {Node} compileNode The raw DOM node to apply the compile functions to * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the * scope argument is auto-generated to the new * child of the transcluded parent scope. * @param {JQLite} jqCollection If we are working on the root of the compile tree then this @@ -1130,7 +1130,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { * @param {Array.<Function>} postLinkFns * @param {Object} previousCompileContext Context used for previous compilation of the current * node - * @returns linkFn + * @returns {Function} linkFn */ function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, @@ -1576,7 +1576,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { * * `A': attribute * * `C`: class * * `M`: comment - * @returns true if directive was added. + * @returns {boolean} true if directive was added. */ function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, endAttrName) { diff --git a/src/ng/filter.js b/src/ng/filter.js index 5010b130..090b32ca 100644 --- a/src/ng/filter.js +++ b/src/ng/filter.js @@ -56,7 +56,7 @@ * Register filter factory function. * * @param {String} name Name of the filter. - * @param {function} fn The filter factory function which is injectable. + * @param {Function} fn The filter factory function which is injectable. */ diff --git a/src/ng/http.js b/src/ng/http.js index 63948196..a19f146d 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -63,7 +63,7 @@ function headersGetter(headers) { * * @param {*} data Data to transform. * @param {function(string=)} headers Http headers getter fn. - * @param {(function|Array.<function>)} fns Function or an array of functions. + * @param {(Function|Array.<Function>)} fns Function or an array of functions. * @returns {*} Transformed data. */ function transformData(data, headers, fns) { diff --git a/src/ng/interval.js b/src/ng/interval.js index 5357ac89..9857860d 100644 --- a/src/ng/interval.js +++ b/src/ng/interval.js @@ -42,93 +42,93 @@ function $IntervalProvider() { * @returns {promise} A promise which will be notified on each iteration. * * @example - <example module="time"> - <file name="index.html"> - <script> - function Ctrl2($scope,$interval) { - $scope.format = 'M/d/yy h:mm:ss a'; - $scope.blood_1 = 100; - $scope.blood_2 = 120; - - var stop; - $scope.fight = function() { - // Don't start a new fight if we are already fighting - if ( angular.isDefined(stop) ) return; - - stop = $interval(function() { - if ($scope.blood_1 > 0 && $scope.blood_2 > 0) { - $scope.blood_1 = $scope.blood_1 - 3; - $scope.blood_2 = $scope.blood_2 - 4; - } else { - $scope.stopFight(); - } - }, 100); - }; - - $scope.stopFight = function() { - if (angular.isDefined(stop)) { - $interval.cancel(stop); - stop = undefined; - } - }; - - $scope.resetFight = function() { - $scope.blood_1 = 100; - $scope.blood_2 = 120; - } - - $scope.$on('$destroy', function() { - // Make sure that the interval is destroyed too - $scope.stopFight(); - }); - } - - angular.module('time', []) - // Register the 'myCurrentTime' directive factory method. - // We inject $interval and dateFilter service since the factory method is DI. - .directive('myCurrentTime', function($interval, dateFilter) { - // return the directive link function. (compile function not needed) - return function(scope, element, attrs) { - var format, // date format - stopTime; // so that we can cancel the time updates - - // used to update the UI - function updateTime() { - element.text(dateFilter(new Date(), format)); - } - - // watch the expression, and update the UI on change. - scope.$watch(attrs.myCurrentTime, function(value) { - format = value; - updateTime(); - }); - - stopTime = $interval(updateTime, 1000); - - // listen on DOM destroy (removal) event, and cancel the next UI update - // to prevent updating time ofter the DOM element was removed. - element.bind('$destroy', function() { - $interval.cancel(stopTime); - }); - } - }); - </script> - - <div> - <div ng-controller="Ctrl2"> - Date format: <input ng-model="format"> <hr/> - Current time is: <span my-current-time="format"></span> - <hr/> - Blood 1 : <font color='red'>{{blood_1}}</font> - Blood 2 : <font color='red'>{{blood_2}}</font> - <button type="button" data-ng-click="fight()">Fight</button> - <button type="button" data-ng-click="stopFight()">StopFight</button> - <button type="button" data-ng-click="resetFight()">resetFight</button> - </div> - </div> - - </file> - </example> + * <example module="time"> + * <file name="index.html"> + * <script> + * function Ctrl2($scope,$interval) { + * $scope.format = 'M/d/yy h:mm:ss a'; + * $scope.blood_1 = 100; + * $scope.blood_2 = 120; + * + * var stop; + * $scope.fight = function() { + * // Don't start a new fight if we are already fighting + * if ( angular.isDefined(stop) ) return; + * + * stop = $interval(function() { + * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) { + * $scope.blood_1 = $scope.blood_1 - 3; + * $scope.blood_2 = $scope.blood_2 - 4; + * } else { + * $scope.stopFight(); + * } + * }, 100); + * }; + * + * $scope.stopFight = function() { + * if (angular.isDefined(stop)) { + * $interval.cancel(stop); + * stop = undefined; + * } + * }; + * + * $scope.resetFight = function() { + * $scope.blood_1 = 100; + * $scope.blood_2 = 120; + * } + * + * $scope.$on('$destroy', function() { + * // Make sure that the interval is destroyed too + * $scope.stopFight(); + * }); + * } + * + * angular.module('time', []) + * // Register the 'myCurrentTime' directive factory method. + * // We inject $interval and dateFilter service since the factory method is DI. + * .directive('myCurrentTime', function($interval, dateFilter) { + * // return the directive link function. (compile function not needed) + * return function(scope, element, attrs) { + * var format, // date format + * stopTime; // so that we can cancel the time updates + * + * // used to update the UI + * function updateTime() { + * element.text(dateFilter(new Date(), format)); + * } + * + * // watch the expression, and update the UI on change. + * scope.$watch(attrs.myCurrentTime, function(value) { + * format = value; + * updateTime(); + * }); + * + * stopTime = $interval(updateTime, 1000); + * + * // listen on DOM destroy (removal) event, and cancel the next UI update + * // to prevent updating time ofter the DOM element was removed. + * element.bind('$destroy', function() { + * $interval.cancel(stopTime); + * }); + * } + * }); + * </script> + * + * <div> + * <div ng-controller="Ctrl2"> + * Date format: <input ng-model="format"> <hr/> + * Current time is: <span my-current-time="format"></span> + * <hr/> + * Blood 1 : <font color='red'>{{blood_1}}</font> + * Blood 2 : <font color='red'>{{blood_2}}</font> + * <button type="button" data-ng-click="fight()">Fight</button> + * <button type="button" data-ng-click="stopFight()">StopFight</button> + * <button type="button" data-ng-click="resetFight()">resetFight</button> + * </div> + * </div> + * + * </file> + * </example> */ function interval(fn, delay, count, invokeApply) { var setInterval = $window.setInterval, diff --git a/src/ng/q.js b/src/ng/q.js index e7ff26ef..eb3b2bed 100644 --- a/src/ng/q.js +++ b/src/ng/q.js @@ -181,7 +181,7 @@ function $QProvider() { /** * Constructs a promise manager. * - * @param {function(function)} nextTick Function for executing functions in the next turn. + * @param {function(Function)} nextTick Function for executing functions in the next turn. * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for * debugging purposes. * @returns {object} Promise manager. diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index eb1dade2..4878c3ec 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -394,7 +394,7 @@ function $RootScopeProvider(){ * ``` * * - * @param {string|Function(scope)} obj Evaluated as {@link guide/expression expression}. The + * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The * expression value should evaluate to an object or an array which is observed on each * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the * collection will trigger a call to the `listener`. diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 6ccf6a5d..6b7fbcce 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -567,7 +567,7 @@ angular.module('ngAnimate', ['ng']) * removed from it * @param {string} add the CSS classes which will be added to the element * @param {string} remove the CSS class which will be removed from the element - * @param {function=} done the callback function (if provided) that will be fired after the + * @param {Function=} done the callback function (if provided) that will be fired after the * CSS classes have been set on the element */ setClass : function(element, add, remove, doneCallback) { @@ -583,7 +583,7 @@ angular.module('ngAnimate', ['ng']) * @function * * @param {boolean=} value If provided then set the animation on or off. - * @param {jQuery/jqLite element=} element If provided then the element will be used to represent the enable/disable operation + * @param {DOMElement=} element If provided then the element will be used to represent the enable/disable operation * @return {boolean} Current animation state. * * @description diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js index 687e8530..e09e74db 100644 --- a/src/ngRoute/route.js +++ b/src/ngRoute/route.js @@ -552,7 +552,7 @@ function $RouteProvider(){ /** - * @returns the current active route, by matching it against the URL + * @returns {Object} the current active route, by matching it against the URL */ function parseRoute() { // Match a route @@ -570,7 +570,7 @@ function $RouteProvider(){ } /** - * @returns interpolation of the redirect path with the parameters + * @returns {string} interpolation of the redirect path with the parameters */ function interpolate(string, params) { var result = []; diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index a5226721..35dc8f10 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -394,7 +394,7 @@ function decodeEntities(value) { * resulting string can be safely inserted into attribute or * element text. * @param value - * @returns escaped text + * @returns {string} escaped text */ function encodeEntities(value) { return value. |
