Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

FnService - Function Service

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.

Note: some of these functions are repeats of jQuery functions. Since we are not using jQuery, we wrote our own implementation.

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.
debugOnReturns true if the debug flag is turned on in query params.
findSearches through an array of objects looking for the one with the tagged property with a given key.
inArrayChecks if an item is in the array.
removeFromArrayRemoves specified item from the array.
isEmptyObjectReturns true if the object is empty.
capReturns the 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.

 

Function Descriptions

isF

isA

isS

isO

contains

areFunctions

areFunctionsNonStrict

windowSize

isMobile

debugOn

find

inArray

removeFromArray

isEmptyObject

cap

noPx

noPxStyle

endsWith

parseBitRate

  • No labels