Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T = any

Hierarchy

Index

Constructors

constructor

  • new MVCArray<T>(array?: null | T[]): MVCArray<T>

Methods

addListener

  • Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with google.maps.event.removeListener.

    Parameters

    • eventName: string
    • handler: Function

    Returns MapsEventListener

bindTo

  • bindTo(key: string, target: MVCObject, targetKey?: null | string, noNotify?: boolean): void
  • Binds a View to a Model.

    Parameters

    • key: string
    • target: MVCObject
    • Optional targetKey: null | string
    • Optional noNotify: boolean

    Returns void

clear

  • clear(): void
  • Removes all elements from the array.

    Returns void

forEach

  • forEach(callback: (a: T, b: number) => void): void
  • Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index).

    Parameters

    • callback: (a: T, b: number) => void
        • (a: T, b: number): void
        • Parameters

          • a: T
          • b: number

          Returns void

    Returns void

get

  • get(key: string): any
  • Gets a value.

    Parameters

    • key: string

    Returns any

getArray

  • getArray(): T[]
  • Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object.

    Returns T[]

getAt

  • getAt(i: number): T
  • Returns the element at the specified index.

    Parameters

    • i: number

    Returns T

getLength

  • getLength(): number
  • Returns the number of elements in this array.

    Returns number

insertAt

  • insertAt(i: number, elem: T): void
  • Inserts an element at the specified index.

    Parameters

    • i: number
    • elem: T

    Returns void

notify

  • notify(key: string): void
  • Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to.

    Parameters

    • key: string

    Returns void

pop

  • pop(): T
  • Removes the last element of the array and returns that element.

    Returns T

push

  • push(elem: T): number
  • Adds one element to the end of the array and returns the new length of the array.

    Parameters

    • elem: T

    Returns number

removeAt

  • removeAt(i: number): T
  • Removes an element from the specified index.

    Parameters

    • i: number

    Returns T

set

  • set(key: string, value: any): void
  • Sets a value.

    Parameters

    • key: string
    • value: any

    Returns void

setAt

  • setAt(i: number, elem: T): void
  • Sets an element at the specified index.

    Parameters

    • i: number
    • elem: T

    Returns void

setValues

  • setValues(values?: null | object): void
  • Sets a collection of key-value pairs.

    Parameters

    • Optional values: null | object

    Returns void

unbind

  • unbind(key: string): void
  • Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed.

    Parameters

    • key: string

    Returns void

unbindAll

  • unbindAll(): void

Generated using TypeDoc