Constructors

  • Parameters

    • $rootScope: Scope
    • $animate: any
    • $exceptionHandler: any
    • $sce: any
    • Optionalelement: JQLite
    • OptionalattributesToCopy: any

    Returns Attributes

Properties

$$element: JQLite
$$observers: any
$animate: any
$attr: {}
$exceptionHandler: any
$normalize: ((name: string) => string) = directiveNormalize

Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.

Also there is special case for Moz prefix starting with upper case letter.

For further information check out the guide on guide/directive#matching-directives Matching Directives

Type declaration

    • (name): string
    • Converts all accepted directives format into proper directive name.

      Parameters

      • name: string

        Name to normalize

      Returns string

Name to normalize

$rootScope: Scope
$sce: any
srcset: any

Methods

  • Adds the CSS class value specified by the classVal parameter to the element. If animations are enabled then an animation will be triggered for the class addition.

    Parameters

    • classVal: string

      The className value that will be added to the element

    Returns void

  • Observes an interpolated attribute.

    The observer function will be invoked once during the next $digest following compilation. The observer is then invoked whenever the interpolated value changes.

    Parameters

    • key: string

      Normalized key. (ie ngAttribute) .

    • fn: any

      Function that will be called whenever the interpolated value of the attribute changes. See the guide/interpolation#how-text-and-attribute-bindings-work Interpolation guide for more info.

    Returns (() => any)

    Returns a deregistration function for this observer.

      • (): any
      • Returns any

  • Removes the CSS class value specified by the classVal parameter from the element. If animations are enabled then an animation will be triggered for the class removal.

    Parameters

    • classVal: string

      The className value that will be removed from the element

    Returns void

  • Set a normalized attribute on the element in a way such that all directives can share the attribute. This function properly handles boolean attributes.

    Parameters

    • key: string

      Normalized key. (ie ngAttribute)

    • value: string | boolean

      The value to set. If null attribute will be deleted.

    • writeAttr: boolean

      If false, does not write the value to DOM element attribute. Defaults to true.

    • attrName: string

      Optional none normalized name. Defaults to key.

    Returns void

  • Adds and removes the appropriate CSS class values to the element based on the difference between the new and old CSS class values (specified as newClasses and oldClasses).

    Parameters

    • newClasses: string

      The current CSS className value

    • oldClasses: string

      The former CSS className value

    Returns void