attribute

Attribute.prototype.attribute

The get accessor returns the attribute, the primitive value of a specified Attribute object.

attribute.class.ts
public get attribute(): `${Name}="${Value}"` {
  return this.valueOf();
}

Returns

The return value is the attribute of a generic type variables Name and Value on the template ${Name}="${Value}".

Example usage

// Example usage.
import { Attribute } from '@angular-package/tag';

// Define a new Attribute.
const colorRed = new Attribute('color', 'red');

// Returns color="red" of type "color=\"red\"".
colorRed.attribute;

Last updated