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/ng | |
| 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/ng')
| -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 |
8 files changed, 107 insertions, 107 deletions
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`. |
