common | UI-Router
Options
All
  • Public
  • Public/Protected
  • All
Menu

External module common

Higher order functions

Index

Type aliases

IInjectable: Function | Array<any>
Mapper: function

Type declaration

    • (x: X, key?: string | number): T
    • Parameters

      • x: X
      • key Optional: string | number

      Returns T

PickOmitPredicate: function

Type declaration

    • (keys: string[], key: any): boolean
    • Parameters

      • keys: string[]
      • key: any

      Returns boolean

Predicate: function

Type declaration

    • (X: any): boolean
    • Parameters

      • X: any

      Returns boolean

Variables

abstractKey: string
angular: any
copy: any
equals: any
extend: any
forEach: any
fromJson: any
isArray: isArray
isDefined: (Anonymous function)
isFunction: (Anonymous function)
isNumber: (Anonymous function)
isPromise: Function

Predicate which checks if a value looks like a Promise

Predicate which checks if a value looks like a Promise

It is probably a Promise if it's an object, and it has a then property which is a Function

isString: (Anonymous function)
isUndefined: (Anonymous function)
mapObj: function

Given an object, returns a new object, where each property is transformed by the callback function

Given an object, returns a new object, where each property is transformed by the callback function

Type declaration

    • <T, U>(collection: object, callback: Mapper): object
    • Type parameters

      • T

      • U

      Parameters

      • collection: object
        • [key: string]: T
      • callback: Mapper

      Returns object

      • [key: string]: U
none: Function
propEq: Function

Given a property name and a value, returns a function that returns a boolean based on whether the passed object has a property that matches the value let obj = { foo: 1, name: "blarg" }; let getName = propEq("name", "blarg"); getName(obj) === true

Given a property name and a value, returns a function that returns a boolean based on whether the passed object has a property that matches the value let obj = { foo: 1, name: "blarg" }; let getName = propEq("name", "blarg"); getName(obj) === true

removeFrom: Function

Given an array, and an item, if the item is found in the array, it removes it (in-place). The same array is returned

Given an array, and an item, if the item is found in the array, it removes it (in-place). The same array is returned

stringifyPattern: Function
toJson: any
toStr: toString
trace: Trace

Functions

  • _arraysEq(a1: any, a2: any): any
  • _copy(src: any, dest: any): any
  • shallow copy from src to dest

  • shallow copy from src to dest

    note: This is a shallow copy, while angular.copy is a deep copy. ui-router uses copy only to make copies of state parameters.

    Parameters

    • src: any
    • dest: any

    Returns any


  • _copyProps(to: any, from: any): any
  • _equals(o1: any, o2: any): any
  • _extend(toObj: any, fromObj: any): any
  • _extend(toObj: any, ...fromObj: Array<any>): any
  • _forEach(obj: any, cb: any, _this: any): any
  • _fromJson(json: any): any
  • _toJson(obj: any): string
  • all(fn1: any): (Anonymous function)
  • Check if all the elements of an array match a predicate function

  • Check if all the elements of an array match a predicate function

    Parameters

    • fn1: any
      :

      a predicate function fn1

    Returns (Anonymous function)

    :

    a function which takes an array and returns true if fn1 is true for all elements of the array


  • allTrueR(memo: boolean, elem: any): any
  • Reduce function that returns true if all of the values are truthy.

  • Reduce function that returns true if all of the values are truthy.

    Parameters

    • memo: boolean
    • elem: any

    Returns any


  • ancestors(first: any, second: any): Array<any>
  • Finds the common ancestor path between two states.

  • Finds the common ancestor path between two states.

    Parameters

    • first: any
      :

      The first state.

    • second: any
      :

      The second state.

    Returns Array<any>

    :

    Returns an array of state names in descending order, not including the root.


  • and(fn1: any, fn2: any): Function
  • Given two functions that return truthy or falsey values, returns a function that returns truthy if both functions return truthy for the given arguments

  • Given two functions that return truthy or falsey values, returns a function that returns truthy if both functions return truthy for the given arguments

    Parameters

    • fn1: any
    • fn2: any

    Returns Function


  • any(fn1: any): (Anonymous function)
  • anyTrueR(memo: boolean, elem: any): any
  • Reduce function that returns true if any of the values are truthy.

  • Reduce function that returns true if any of the values are truthy.

    • @example ```

    let vals = [ 0, null, undefined ]; vals.reduce(anyTrueR, true); // false

    vals.push("hello world"); vals.reduce(anyTrueR, true); // true ```

    Parameters

    • memo: boolean
    • elem: any

    Returns any


  • applyPairs(memo: TypedMap<any>, keyValTuple: any[]): TypedMap<any>
  • Reduce function which builds an object from an array of [key, value] pairs.

  • Reduce function which builds an object from an array of [key, value] pairs.

    Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.

    Each keyValueTuple should be an array with values [ key: string, value: any ]

    example
    
    var pairs = [ ["fookey", "fooval"], ["barkey", "barval"] ]
    
    var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})
    // pairsToObj == { fookey: "fooval", barkey: "barval" }
    
    // Or, more simply:
    var pairsToObj = pairs.reduce(applyPairs, {})
    // pairsToObj == { fookey: "fooval", barkey: "barval" }
    

    Parameters

    • memo: TypedMap<any>
    • keyValTuple: any[]

    Returns TypedMap<any>


  • arrayTuples(...arrayArgs: any[]): any[]
  • Given two or more parallel arrays, returns an array of tuples where each tuple is composed of [ a[i], b[i], ... z[i] ]

  • Given two or more parallel arrays, returns an array of tuples where each tuple is composed of [ a[i], b[i], ... z[i] ]

    example
    
    let foo = [ 0, 2, 4, 6 ];
    let bar = [ 1, 3, 5, 7 ];
    let baz = [ 10, 30, 50, 70 ];
    arrayTuples(foo, bar);       // [ [0, 1], [2, 3], [4, 5], [6, 7] ]
    arrayTuples(foo, bar, baz);  // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]
    

    Parameters

    • ...arrayArgs Rest: any[]

    Returns any[]


  • assertPredicate<T>(fn: Predicate, errMsg?: string | Function): Predicate
  • Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.

  • Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.

    example
    
    let isNumber = (obj) => typeof(obj) === 'number';
    let allNumbers = [ 1, 2, 3, 4, 5 ];
    allNumbers.filter(assertPredicate(isNumber)); //OK
    
    let oneString = [ 1, 2, 3, 4, "5" ];
    oneString.filter(assertPredicate(isNumber, "Not all numbers")); // throws Error(""Not all numbers"");
    

    Type parameters

    • T

    Parameters

    • fn: Predicate
    • errMsg Default value: string | Function = "assert failure"

    Returns Predicate


  • bindFunctions(from: any, to: any, bindTo: any, fnNames?: string[]): void
  • Binds and copies functions onto an object

  • Binds and copies functions onto an object

    Takes functions from the 'from' object, binds those functions to the _this object, and puts the bound functions on the 'to' object.

    This example creates an new class instance whose functions are prebound to the new'd object.

    example
    
    class Foo {
      constructor(data) {
        // Binds all functions from Foo.prototype to 'this',
        // then copies them to 'this'
        bindFunctions(Foo.prototype, this, this);
        this.data = data;
      }
    
      log() {
        console.log(this.data);
      }
    }
    
    let myFoo = new Foo([1,2,3]);
    var logit = myFoo.log;
    logit(); // logs [1, 2, 3] from the myFoo 'this' instance
    

    This example creates a bound version of a service function, and copies it to another object

    example
    
    var SomeService = {
      this.data = [3, 4, 5];
      this.log = function() {
        console.log(this.data);
      }
    }
    
    // Constructor fn
    function OtherThing() {
      // Binds all functions from SomeService to SomeService,
      // then copies them to 'this'
      bindFunctions(SomeService, this, SomeService);
    }
    
    let myOtherThing = new OtherThing();
    myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'
    

    Parameters

    • from: any
      :

      The object which contains the functions to be bound

    • to: any
      :

      The object which will receive the bound functions

    • bindTo: any
      :

      The object which the functions will be bound to

    • fnNames Default value: string[] = Object.keys(from)
      :

      The function names which will be bound (Defaults to all the functions found on the 'from' object)

    Returns void


  • compose(): (Anonymous function)
  • Given a varargs list of functions, returns a function that composes the argument functions, right-to-left given: f(x), g(x), h(x) let composed = compose(f,g,h) then, composed is: f(g(h(x)))

  • Given a varargs list of functions, returns a function that composes the argument functions, right-to-left given: f(x), g(x), h(x) let composed = compose(f,g,h) then, composed is: f(g(h(x)))

    Returns (Anonymous function)


  • curry(fn: Function): Function
  • Returns a new function for Partial Application of the original function.

  • Returns a new function for Partial Application of the original function.

    Given a function with N parameters, returns a new function that supports partial application. The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters, where M is less than N, it returns a new function that accepts the remaining parameters. It continues to accept more parameters until all N parameters have been supplied.

    This contrived example uses a partially applied function as an predicate, which returns true if an object is found in both arrays.

    example
    // returns true if an object is in both of the two arrays
    function inBoth(array1, array2, object) {
      return array1.indexOf(object) !== -1 &&
             array2.indexOf(object) !== 1;
    }
    let obj1, obj2, obj3, obj4, obj5, obj6, obj7
    let foos = [obj1, obj3]
    let bars = [obj3, obj4, obj5]
    
    // A curried "copy" of inBoth
    let curriedInBoth = curry(inBoth);
    // Partially apply both the array1 and array2
    let inFoosAndBars = curriedInBoth(foos, bars);
    
    // Supply the final argument; since all arguments are
    // supplied, the original inBoth function is then called.
    let obj1InBoth = inFoosAndBars(obj1); // false
    
    // Use the inFoosAndBars as a predicate.
    // Filter, on each iteration, supplies the final argument
    let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];
    let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]
    

    Stolen from: http://stackoverflow.com/questions/4394747/javascript-curry-function

    Parameters

    • fn: Function
      :

    Returns Function

    :

  • defaults(opts?: object, ...defaultsList: Array<any>): any
  • Applies a set of defaults to an options object. The options object is filtered to only those properties of the objects in the defaultsList. Earlier objects in the defaultsList take precedence when applying defaults.

  • Applies a set of defaults to an options object. The options object is filtered to only those properties of the objects in the defaultsList. Earlier objects in the defaultsList take precedence when applying defaults.

    Parameters

    • opts Default value: object = {}
    • ...defaultsList Rest: Array<any>

    Returns any


  • eq(val: any): (Anonymous function)
  • Given a value, returns a Predicate function that returns true if another value is === equal to the original value

  • Given a value, returns a Predicate function that returns true if another value is === equal to the original value

    Parameters

    • val: any

    Returns (Anonymous function)


  • equalForKeys(a: any, b: any, keys?: string[]): boolean
  • Performs a non-strict comparison of the subset of two objects, defined by a list of keys.

  • Performs a non-strict comparison of the subset of two objects, defined by a list of keys.

    Parameters

    • a: any
      :

      The first object.

    • b: any
      :

      The second object.

    • keys Default value: string[] = Object.keys(a)
      :

      The list of keys within each object to compare. If the list is empty or not specified, it defaults to the list of keys in a.

    Returns boolean

    :

    Returns true if the keys match, otherwise false.


  • filter<T>(collection: T[], callback: function): T[]
  • Given an array of objects, returns a new array containing only the elements which passed the callback predicate

  • filter<T>(collection: TypedMap<T>, callback: function): TypedMap<T>
  • Given an object, returns a new object with only those properties that passed the callback predicate

  • Given an array of objects, returns a new array containing only the elements which passed the callback predicate

    Type parameters

    • T

    Parameters

    • collection: T[]
    • callback: function
        • (T: any, key?: any): boolean
        • Parameters

          • T: any
          • key Optional: any

          Returns boolean

    Returns T[]


  • Given an object, returns a new object with only those properties that passed the callback predicate

    Type parameters

    • T

    Parameters

    • collection: TypedMap<T>
    • callback: function
        • (T: any, key?: any): boolean
        • Parameters

          • T: any
          • key Optional: any

          Returns boolean

    Returns TypedMap<T>


  • find<T>(collection: TypedMap<T>, callback: Predicate): T
  • Given an object, return the first property of that object which passed the callback predicate

  • find<T>(collection: T[], callback: Predicate): T
  • Given an array of objects, returns the first object which passed the callback predicate

  • Given an object, return the first property of that object which passed the callback predicate

    Type parameters

    • T

    Parameters

    Returns T


  • Given an array of objects, returns the first object which passed the callback predicate

    Type parameters

    • T

    Parameters

    Returns T


  • flatten(arr: any[]): any
  • Return a completely flattened version of an array.

  • Return a completely flattened version of an array.

    Parameters

    • arr: any[]

    Returns any


  • flattenR(memo: any[], elem: any): Array<any>
  • Reduce function which recursively un-nests all arrays

  • Reduce function which recursively un-nests all arrays

    Parameters

    • memo: any[]
    • elem: any

    Returns Array<any>


  • functionToString(fn: any): any
  • identity(x: any): any
  • inArray(array: any[], obj: any): boolean
  • Given an array, returns true if the object is found in the array, (using indexOf)

  • Given an array, returns true if the object is found in the array, (using indexOf)

    Parameters

    • array: any[]
    • obj: any

    Returns boolean


  • inherit(parent: any, extra: any): any
  • prototypal inheritance helper. Creates a new object which has parent object as its prototype, and then copies the properties from extra onto it

  • prototypal inheritance helper. Creates a new object which has parent object as its prototype, and then copies the properties from extra onto it

    Parameters

    • parent: any
    • extra: any

    Returns any


  • invoke(fnName: string): Function
  • invoke(fnName: string, args: any[]): Function
  • is(ctor: any): (Anonymous function)
  • Given a class, returns a Predicate function that returns true if the object is of that class

  • Given a class, returns a Predicate function that returns true if the object is of that class

    Parameters

    • ctor: any

    Returns (Anonymous function)


  • isDate(x: any): boolean
  • isInjectable(val: any): boolean
  • Predicate which checks if a value is injectable

  • Predicate which checks if a value is injectable

    A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array where all the elements in the array are Strings, except the last one, which is a Function

    Parameters

    • val: any

    Returns boolean


  • isNull(o: any): boolean
  • isObject(x: any): boolean
  • isRegExp(x: any): boolean
  • kebobString(camelCase: string): string
  • map<T, U>(collection: T[], callback: Mapper): U[]
  • Given an array, returns a new array, where each element is transformed by the callback function

  • map<T, U>(collection: object, callback: Mapper): object
  • Maps an array or object properties using a callback function

  • Given an array, returns a new array, where each element is transformed by the callback function

    Type parameters

    • T

    • U

    Parameters

    • collection: T[]
    • callback: Mapper

    Returns U[]


  • Maps an array or object properties using a callback function

    Type parameters

    • T

    • U

    Parameters

    • collection: object
      • [key: string]: T
    • callback: Mapper

    Returns object

    • [key: string]: U

  • maxLength(max: number, str: string): string
  • Returns a string shortened to a maximum length

  • Returns a string shortened to a maximum length

    If the string is already less than the max length, return the string. Else return the string, shortened to max - 3 and append three dots ("...").

    Parameters

    • max: number
      :

      the maximum length of the string to return

    • str: string
      :

      the input string

    Returns string


  • merge(dst: any, ...objs: Object[]): any
  • Merges properties from the list of objects to the destination object. If a property already exists in the destination object, then it is not overwritten.

  • Merges properties from the list of objects to the destination object. If a property already exists in the destination object, then it is not overwritten.

    Parameters

    • dst: any
    • ...objs Rest: Object[]

    Returns any


  • mergeR(memo: any, item: any): any
  • Reduce function that merges each element of the list into a single object, using extend

  • Reduce function that merges each element of the list into a single object, using extend

    Parameters

    • memo: any
    • item: any

    Returns any


  • noop(): any
  • normalizedCat(input: Category): string
  • not(fn: any): (Anonymous function)
  • Given a function that returns a truthy or falsey value, returns a function that returns the opposite (falsey or truthy) value given the same inputs

  • Given a function that returns a truthy or falsey value, returns a function that returns the opposite (falsey or truthy) value given the same inputs

    Parameters

    • fn: any

    Returns (Anonymous function)


  • notImplemented(fnname: any): (Anonymous function)
  • for typedoc

  • omit(obj: any, propNames: string[]): Object
  • Return a copy of the object omitting the blacklisted properties.

  • omit(obj: any, ...propNames: string[]): Object
  • Return a copy of the object omitting the blacklisted properties.

  • Return a copy of the object omitting the blacklisted properties.

    example
    
    var foo = { a: 1, b: 2, c: 3 };
    var ab = omit(foo, ['a', 'b']); // { c: 3 }
    

    Parameters

    • obj: any
      :

      the source object

    • propNames: string[]
      :

      an Array of strings, which are the blacklisted property names

    Returns Object


  • Return a copy of the object omitting the blacklisted properties.

    example
    
    var foo = { a: 1, b: 2, c: 3 };
    var ab = omit(foo, 'a', 'b'); // { c: 3 }
    

    Parameters

    • obj: any
      :

      the source object

    • ...propNames Rest: string[]
      :

      1..n strings, which are the blacklisted property names

    Returns Object


  • or(fn1: any, fn2: any): Function
  • Given two functions that return truthy or falsey values, returns a function that returns truthy if at least one of the functions returns truthy for the given arguments

  • Given two functions that return truthy or falsey values, returns a function that returns truthy if at least one of the functions returns truthy for the given arguments

    Parameters

    • fn1: any
    • fn2: any

    Returns Function


  • padString(length: number, str: string): string
  • Returns a string, with spaces added to the end, up to a desired str length

  • Returns a string, with spaces added to the end, up to a desired str length

    If the string is already longer than the desired length, return the string. Else returns the string, with extra spaces on the end, such that it reaches length characters.

    Parameters

    • length: number
      :

      the desired length of the string to return

    • str: string
      :

      the input string

    Returns string


  • pairs(object: any): Array<Array<any>>
  • Like _.pairs: Given an object, returns an array of key/value pairs

  • Like _.pairs: Given an object, returns an array of key/value pairs

    Parameters

    • object: any

    Returns Array<Array<any>>


  • parse(name: string): any
  • Given a dotted property name, returns a function that returns a nested property from an object, or undefined let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, }; let getName = prop("nestedObj.name"); getName(obj) === "blarg" let propNotFound = prop("this.property.doesnt.exist"); propNotFound(obj) === undefined

  • Given a dotted property name, returns a function that returns a nested property from an object, or undefined let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, }; let getName = prop("nestedObj.name"); getName(obj) === "blarg" let propNotFound = prop("this.property.doesnt.exist"); propNotFound(obj) === undefined

    Parameters

    • name: string

    Returns any


  • pattern(struct: Function[]): Function
  • Sorta like Pattern Matching (a functional programming conditional construct)

  • Sorta like Pattern Matching (a functional programming conditional construct)

    See http://c2.com/cgi/wiki?PatternMatching

    This is a conditional construct which allows a series of predicates and output functions to be checked and then applied. Each predicate receives the input. If the predicate returns truthy, then its matching output function (mapping function) is provided with the input and, then the result is returned.

    Each combination (2-tuple) of predicate + output function should be placed in an array of size 2: [ predicate, mapFn ]

    These 2-tuples should be put in an outer array.

    example
    
    // Here's a 2-tuple where the first element is the isString predicate
    // and the second element is a function that returns a description of the input
    let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
    
    // Second tuple: predicate "isNumber", mapfn returns a description
    let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
    
    let third = [ (input) => input === null,  (input) => `Oh, null...` ];
    
    let fourth = [ (input) => input === undefined,  (input) => `notdefined` ];
    
    let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
    
    console.log(descriptionOf(undefined)); // 'notdefined'
    console.log(descriptionOf(55)); // '(55) That's a number!'
    console.log(descriptionOf("foo")); // 'Here's your string foo'
    

    Parameters

    • struct: Function[]
      :

      A 2D array. Each element of the array should be an array, a 2-tuple, with a Predicate and a mapping/output function

    Returns Function

    :

  • pick(obj: any, propNames: string[]): Object
  • Return a copy of the object only containing the whitelisted properties.

  • pick(obj: any, ...propNames: string[]): Object
  • Return a copy of the object only containing the whitelisted properties.

  • Return a copy of the object only containing the whitelisted properties.

    example
    
    var foo = { a: 1, b: 2, c: 3 };
    var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }
    

    Parameters

    • obj: any
      :

      the source object

    • propNames: string[]
      :

      an Array of strings, which are the whitelisted property names

    Returns Object


  • Return a copy of the object only containing the whitelisted properties.

    example
    
    var foo = { a: 1, b: 2, c: 3 };
    var ab = pick(foo, 'a', 'b'); // { a: 1, b: 2 }
    

    Parameters

    • obj: any
      :

      the source object

    • ...propNames Rest: string[]
      :

      1..n strings, which are the whitelisted property names

    Returns Object


  • pipe(...funcs: Function[]): function
  • Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right given: f(x), g(x), h(x) let piped = pipe(f,g,h); then, piped is: h(g(f(x)))

  • Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right given: f(x), g(x), h(x) let piped = pipe(f,g,h); then, piped is: h(g(f(x)))

    Parameters

    • ...funcs Rest: Function[]

    Returns function

      • (obj: any): any
      • Parameters

        • obj: any

        Returns any


  • pluck(collection: any[], propName: string): any[]
  • Given an array of objects, maps each element to a named property of the element.

  • pluck(collection: object, propName: string): object
  • Given an object, maps each property of the object to a named property of the property.

  • Given an array of objects, maps each element to a named property of the element.

    Parameters

    • collection: any[]
    • propName: string

    Returns any[]


  • Given an object, maps each property of the object to a named property of the property.

    Parameters

    • collection: object
      • [key: string]: any
    • propName: string

    Returns object

    • [key: string]: any

  • promiseToString(p: any): any
  • prop(name: string): (Anonymous function)
  • Given a property name, returns a function that returns that property from an object let obj = { foo: 1, name: "blarg" }; let getName = prop("name"); getName(obj) === "blarg"

  • Given a property name, returns a function that returns that property from an object let obj = { foo: 1, name: "blarg" }; let getName = prop("name"); getName(obj) === "blarg"

    Parameters

    • name: string

    Returns (Anonymous function)


  • pushR(arr: any[], obj: any): Array<any>
  • Reduce function that pushes an object to an array, then returns the array. Mostly just for flattenR

  • Reduce function that pushes an object to an array, then returns the array. Mostly just for flattenR

    Parameters

    • arr: any[]
    • obj: any

    Returns Array<any>


  • restArgs(args: any, idx?: number): any
  • Given an arguments object, converts the arguments at index idx and above to an array. This is similar to es6 rest parameters.

  • Given an arguments object, converts the arguments at index idx and above to an array. This is similar to es6 rest parameters.

    Optionally, the argument at index idx may itself already be an array.

    For example, given either: arguments = [ obj, "foo", "bar" ] or: arguments = [ obj, ["foo", "bar"] ] then: restArgs(arguments, 1) == ["foo", "bar"]

    This allows functions like pick() to be implemented such that it allows either a bunch of string arguments (like es6 rest parameters), or a single array of strings:

    given: var obj = { foo: 1, bar: 2, baz: 3 }; then: pick(obj, "foo", "bar"); // returns { foo: 1, bar: 2 } pick(obj, ["foo", "bar"]); // returns { foo: 1, bar: 2 }

    Parameters

    • args: any
    • idx Default value: number = 0

    Returns any


  • stringify(o: any): string
  • tail<T>(arr: T[]): T
  • Get the last element of an array

  • Get the last element of an array

    Type parameters

    • T

    Parameters

    • arr: T[]

    Returns T


  • tis(t: any): (Anonymous function)
  • uiViewString(viewData: any): string
  • unnest(arr: any[]): any
  • Return a new array with a single level of arrays unnested.

  • Return a new array with a single level of arrays unnested.

    Parameters

    • arr: any[]

    Returns any


  • unnestR(memo: any[], elem: any): Array<any>
  • Reduce function which un-nests a single level of arrays

  • Reduce function which un-nests a single level of arrays

    Parameters

    • memo: any[]
    • elem: any

    Returns Array<any>


  • val<T>(v: T): (Anonymous function)
  • Given a value, returns a function which returns the value

  • Given a value, returns a function which returns the value

    Type parameters

    • T

    Parameters

    • v: T

    Returns (Anonymous function)


  • values(obj: any): Array<any>
  • Given an object, return its enumerable property values

  • Given an object, return its enumerable property values

    Parameters

    • obj: any

    Returns Array<any>


  • viewConfigString(viewConfig: ViewConfig): string

Object literals

services: object
$injector: undefined
$q: undefined
location: any
locationConfig: any
template: any

Generated using TypeDoc