[Symbol.toStringTag]

[Symbol.toStringTag]

The get accessor, with the help of toStringTag of Symbol, changes the default object tag to attribute for an instance of the Attribute.

Good to know: The property can be read by the typeOf() function of the type package.

attribute.class.ts
public get [Symbol.toStringTag](): string {
  return 'attribute';
}

Example usage

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

// Define the attribute.
const attributeColor = new Attribute('color', 'red');

// Returns 'attribute'.
typeOf(attributeColor);

Last updated