/** * @ngdoc function * @name angular.isNumber * @module ng * @kind function * * @description * Determines if a reference is a `Number`. *判断一个引用是否是数字 * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`. *包含特殊number NaN `+Infinity` and `-Infinity`. * If you wish to exclude these then you can use the native * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) * method. * * @param {*} value Reference to check. * @returns {boolean} True if `value` is a `Number`. */ functionisNumber(value) {returntypeof value === 'number';}
nextUid
1 2 3 4 5 6 7 8 9 10 11 12 13
/** * A consistent(一致的) way of creating unique IDs in angular. * * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before * we hit number precision issues in JavaScript. * * Math.pow(2,53) 2的53次幂/ 60 / 60 / 24 / 365 / 10 = 28.6M * * @returns {number} an unique alpha-numeric string */ functionnextUid() { return ++uid; }