Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NgFilter

An angular filter. They can be registered through the ProjectSettings setup. You must give a name, and the type for the filter. Example: new NgFilter("translate", "(key: string) => string")

You can also supply a addScopeToParam function: you are given the parameter index, and are called with the parameter, so you can or not add scope accessors. 99% of the time you want scope accessors for filter parameters, but for instance 'filter' allows you to specify a pattern for items through an object literal. If the filter spec is {name: "test"}, we certainly don't want to change it to: {$scope.name: "test"}.

Hierarchy

  • NgFilter

Index

Constructors

Properties

Constructors

constructor

  • new NgFilter(name: string, type: string, addScopeToParam?: undefined | function): NgFilter
  • Parameters

    • name: string

      The name of the angular filter

    • type: string

      The type that'll be used to type-check uses of the filter.

    • Optional addScopeToParam: undefined | function

      Customize the scope adding for parameter index n For instance for 'filter', we shouldn't wrap the values in the scope for the 'expression' parameter, which is a spec of the values to keep.

    Returns NgFilter

Properties

addScopeToParam

addScopeToParam: function

Type declaration

    • (paramIndex: number, input: string, addScopeAccessors: function): string
    • Parameters

      • paramIndex: number
      • input: string
      • addScopeAccessors: function
          • (input: string): string
          • Parameters

            • input: string

            Returns string

      Returns string

name

name: string

The name of the angular filter

type

type: string

The type that'll be used to type-check uses of the filter.

Generated using TypeDoc