angular-package
TwitterGitHub
Text
Text
  • Introduction
  • Benefits
  • Getting started
    • General concepts
    • Skeleton
    • Installation
    • Public API
  • Wrapper
    • Basic concepts
    • Wrap
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Wrap() constructor
      • Instance methods
      • Examples
    • Wrapper
      • Generic type variables
      • Static properties
      • Instance accessors
      • Static methods
      • Wrapper() constructor
      • Instance methods
      • Examples
    • Wrapped
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Wrapped() constructor
      • Instance methods
      • Types
      • Examples
  • Tag
    • Basic concepts
    • Tag
      • Generic type variables
      • Static accessors
      • Static properties
      • Instance accessors
      • Instance properties
      • Static methods
      • Tag() constructor
      • Instance methods
      • Types
      • Examples
    • BBCodeTag
      • Static methods
      • BBCodeTag() constructor
    • HtmlTag
      • Generic type variables
      • HtmlTag() constructor
    • Tags
    • Tagged
  • Main
    • AllowedChars
    • Attribute
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Attribute() constructor
      • Instance methods
    • Attributes
    • Template
    • Text
  • Legend
    • Property tags
  • Other
    • Contact
    • Sponsor
  • More versions
Powered by GitBook
On this page
  • Public
  • Tag.prototype.attributes
  • Tag.prototype.closingTag
  • Tag.prototype.name
  • Tag.prototype.openingTag
  • Tag.prototype.tag
  • Tag.prototype.wrapper
  • Tag.prototype.value
  • [Symbol.toStringTag]

Was this helpful?

  1. Tag
  2. Tag

Instance accessors

PreviousStatic propertiesNextInstance properties

Last updated 3 years ago

Was this helpful?

Public

Tag.prototype.attributes

The accessor returns the tag attributes if set, otherwise undefined.

public get attributes(): Attributes | undefined {
  return this.#attributes;
}

Returns

The return value is a tag attributes of an if set, or undefined.

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`, `<`, `>`, ['color', 'red']);

// Returns

Tag.prototype.closingTag

public get closingTag(): ClosingTag<Name, Opening, Closing> {
  return `${this.#wrapper.opening}/${this.#name}${
    this.#wrapper.closing
  }`;
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`);

// Returns [/quote].
tag.closingTag;

Tag.prototype.name

public get name(): Name {
  return this.#name;
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`);

// Returns quote.
tag.name;

Tag.prototype.openingTag

public get openingTag(): OpeningTag<Name, Chars> {
  return this.tag as OpeningTag<Name, Chars>;
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag <span color="red">.
const tag = new Tag(`span`, `<`, `>`, ['color', 'red']);

// Returns <span color="red">.
tag.openingTag;

Tag.prototype.tag

public get tag(): `${Opening}${Name}${Closing}` {
  return `${this.#wrapper.opening}${this.#name}${
    this.#wrapper.closing
  }`;
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`);

// Returns [quote].
tag.tag;

Tag.prototype.wrapper

ppublic get wrapper(): Wrapper<Opening, Closing> {
  return this.#wrapper;
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`);

// Returns Wrapper {'[]'}.
tag.wrapper;

Tag.prototype.value

public get value(): string {
  return this.valueOf();
}

Returns

Example usage

// Example usage.
import { Tag } from '@angular-package/text';

// Create tag [quote].
const tag = new Tag(`quote`);

// Returns [quote].
tag.value;

[Symbol.toStringTag]

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

public get [Symbol.toStringTag](): 'tag' {
  return 'tag';
}

Example usage

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

// Define the tag.
const quoteTag = new Tag('quote');

// Returns 'tag'.
typeOf(quoteTag);

The accessor gets the of a generic type .

The return value is a tag closing of a generic type .

The accessor gets the tag name without the wrap from the private property .

The return value is a tag name of a generic type variables .

The accessor gets tag with optional attributes.

The return value is an opening tag of a generic type .

The accessor gets the tag consists of the name, opening and closing of the wrap.

The return value is a tag of a generic type variables in order , and on the template.

The accessor gets the wrapper.

The return value is the instance.

The accessor gets the tag without the attributes.

The return value is the tag of a generic type variables in order , and on the template.

The property, with the help of of Symbol, changes the default object tag to tag for an instance of the .

get
Attributes
get
get
Wrapper
get
toStringTag
Tag
get
get
get
ClosingTag
OpeningTag
ClosingTag
#name
closing tag
the opening
Name
Opening
Name
Closing
Opening
Name
Closing