An annotation to specify that a constant attribute value should be injected.

The directive can inject constant string literals of host element attributes.

Example

Suppose we have an <input> element and want to know its type.

<input type="text">

A decorator can inject string literal text like so:

@Directive(selector: 'input')
class InputAttrDirective {
  InputAttrDirective(@Attribute('type') String type) {
    // type would be 'text' in this example
  }
}

Constructors

Attribute(String attributeName)
const

Properties

attributeName → String
final
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(other) → bool
The equality operator. [...]
inherited