AngularJS Service with useful utility functions
Methods
(static) isMobile() → {boolean}
Check whether browser is likely to be a mobile device (including an iPad).
- Source:
Returns:
- Type:
-
boolean
(static) isIPad() → {boolean}
Check whether browser is likely to be an iPad.
- Source:
Returns:
- Type:
-
boolean
(static) isIOS() → {boolean}
Check whether browser claims to be iOS.
- Source:
Returns:
- Type:
-
boolean
(static) deepCopy(object) → {*}
Deep copy an object via JSON serialization and deserialization.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
object |
*
|
Any JSON-serializable object. |
Returns:
- Type:
-
*
A deep copy of the object.
(static) generateUUID() → {string}
Generate a Version 4 (random) UUID.
- Source:
Returns:
- Type:
-
string
A 36-character UUID string.
(static) sha256(ascii) → {string}
SHA256 hashing algorithm.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ascii |
string
|
Input string (must only contain 1-byte characters). |
Returns:
- Type:
-
string
A 64-character hexadecimal string hash result.
(static) shuffleArray(array) → {Array}
Durstenfeld shuffle an array.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
array |
Array
|
Source array. |
Returns:
- Type:
-
Array
Shuffled shallow copy of source array.