mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-31 02:41:32 +08:00
style: added whitespace
spaces between the ')' and '{' make code a tad easier to read.
Closes #7542
This commit is contained in:
@@ -215,7 +215,7 @@ function isArrayLike(obj) {
|
||||
```js
|
||||
var values = {name: 'misko', gender: 'male'};
|
||||
var log = [];
|
||||
angular.forEach(values, function(value, key){
|
||||
angular.forEach(values, function(value, key) {
|
||||
this.push(key + ': ' + value);
|
||||
}, log);
|
||||
expect(log).toEqual(['name: misko', 'gender: male']);
|
||||
@@ -229,7 +229,7 @@ function isArrayLike(obj) {
|
||||
function forEach(obj, iterator, context) {
|
||||
var key;
|
||||
if (obj) {
|
||||
if (isFunction(obj)){
|
||||
if (isFunction(obj)) {
|
||||
for (key in obj) {
|
||||
// Need to check if hasOwnProperty exists,
|
||||
// as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
|
||||
@@ -342,9 +342,9 @@ function setHashKey(obj, h) {
|
||||
*/
|
||||
function extend(dst) {
|
||||
var h = dst.$$hashKey;
|
||||
forEach(arguments, function(obj){
|
||||
forEach(arguments, function(obj) {
|
||||
if (obj !== dst) {
|
||||
forEach(obj, function(value, key){
|
||||
forEach(obj, function(value, key) {
|
||||
dst[key] = value;
|
||||
});
|
||||
}
|
||||
@@ -493,7 +493,7 @@ function isNumber(value){return typeof value === 'number';}
|
||||
* @param {*} value Reference to check.
|
||||
* @returns {boolean} True if `value` is a `Date`.
|
||||
*/
|
||||
function isDate(value){
|
||||
function isDate(value) {
|
||||
return toString.call(value) === '[object Date]';
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ function isElement(node) {
|
||||
* @param str 'key1,key2,...'
|
||||
* @returns {object} in the form of {key1:true, key2:true, ...}
|
||||
*/
|
||||
function makeMap(str){
|
||||
function makeMap(str) {
|
||||
var obj = {}, items = str.split(","), i;
|
||||
for ( i = 0; i < items.length; i++ )
|
||||
obj[ items[i] ] = true;
|
||||
@@ -658,7 +658,7 @@ function size(obj, ownPropsOnly) {
|
||||
|
||||
if (isArray(obj) || isString(obj)) {
|
||||
return obj.length;
|
||||
} else if (isObject(obj)){
|
||||
} else if (isObject(obj)) {
|
||||
for (key in obj)
|
||||
if (!ownPropsOnly || obj.hasOwnProperty(key))
|
||||
count++;
|
||||
@@ -757,7 +757,7 @@ function isLeafNode (node) {
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
function copy(source, destination){
|
||||
function copy(source, destination) {
|
||||
if (isWindow(source) || isScope(source)) {
|
||||
throw ngMinErr('cpws',
|
||||
"Can't copy! Making copies of Window or Scope instances is not supported.");
|
||||
@@ -786,7 +786,7 @@ function copy(source, destination){
|
||||
}
|
||||
} else {
|
||||
var h = destination.$$hashKey;
|
||||
forEach(destination, function(value, key){
|
||||
forEach(destination, function(value, key) {
|
||||
delete destination[key];
|
||||
});
|
||||
for ( var key in source) {
|
||||
@@ -1060,7 +1060,7 @@ function tryDecodeURIComponent(value) {
|
||||
*/
|
||||
function parseKeyValue(/**string*/keyValue) {
|
||||
var obj = {}, key_value, key;
|
||||
forEach((keyValue || "").split('&'), function(keyValue){
|
||||
forEach((keyValue || "").split('&'), function(keyValue) {
|
||||
if ( keyValue ) {
|
||||
key_value = keyValue.split('=');
|
||||
key = tryDecodeURIComponent(key_value[0]);
|
||||
@@ -1422,7 +1422,7 @@ function bootstrap(element, modules, config) {
|
||||
}
|
||||
|
||||
var SNAKE_CASE_REGEXP = /[A-Z]/g;
|
||||
function snake_case(name, separator){
|
||||
function snake_case(name, separator) {
|
||||
separator = separator || '_';
|
||||
return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
|
||||
return (pos ? separator : '') + letter.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user