Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FnService is an Angular Factory in the Util module with the name fn.js. It provides general purpose functions that are useful throughout the client-side application. To use these functions, see the documentation on injecting Angular services.

...

NameSummary
isFChecks if argument is a function.
isAChecks if argument is an array.
isS

Checks if argument is a string.

isOChecks if argument is an object.
containsChecks if an array contains a value.
areFunctionsChecks if given strings are names of functions on an API and whether the API has functions that are not listed.
areFunctionsNonStrictChecks if given strings are names of functions on an API. (Doesn't care about unlisted functions.)
windowSizeReturns inner dimensions of the window minus given values.
isMobileReturns true if the device viewing the GUI is a mobile device.
isChromeReturns true if the browser being used is Chrome.
isSafariReturns true if the browser being used is Safari.
isFirefoxReturns true if the browser being used is Firefox.
debugOnReturns true if the debug flag is turned on in query params.
findSearches through an array of objects looking for the object with a specific property name and property value and returns its index.
inArrayFinds an item's index in the array.
removeFromArrayRemoves the first occurrence of the specified item from the array.
isEmptyObjectReturns true if the object is empty (has no non-default properties).
capReturns the given string with only the first letter capitalized.
noPxReturn the argument without the 'px' suffix.
noPxStyle

Return the element's style property without the 'px' suffix.

endsWithChecks if the given string ends with a given suffix.
parseBitRateReturns a Number version of the given string bit rate.

...

Example UsageArgumentsReturn Values
fs.isMobile();none

true if the device viewing the GUI is a mobile device

false otherwise

isChrome

Returns true if the browser being used is Chrome.

Example UsageArgumentsReturn Values
fs.isChrome();none

true if the user is viewing the GUI in Google Chrome

false otherwise

isSafari

Returns true if the browser being used is Safari.

Example UsageArgumentsReturn Values
fs.isSafari();none

true if the user is viewing the GUI in Safari

false otherwise

isFirefox

Returns true if the browser being used is Firefox.

Example UsageArgumentsReturn Values
fs.isFirefox();none

true if the user is viewing the GUI in Mozilla Firefox

false otherwise

debugOn

Returns true if the debug flag is turned on in query params.

...