docs(*): fix jsdoc type expressions
These errors in the docs were preventing some parts of the docs from being parsed.
This commit is contained in:
+6
-6
@@ -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],
|
||||
|
||||
+1
-1
@@ -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)];
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
+7
-7
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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');
|
||||
|
||||
+8
-8
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
+87
-87
@@ -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,
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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`.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user