Instance accessors

Public

Variables.prototype.value

The getarrow-up-right accessor returns the value from a private #value property of a specified Variable object.

variable.class.ts
public get value(): Value | undefined {
  return this.#value;
}

Returns

The return value is the value of a string type from the private #value property if set, otherwise undefined.

Example usage

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

// Returns Variable {'{fix}'} of Variable<"fix", string>.
const fix = new Variable('fix');

// Returns undefined of string | undefined.
fix.value;

// Returns Variable {'{fix}'} of Variable<"fix", "Open the link https://duckduckgo.com/">.
const fixed = new Variable('fix', 'Open the link https://duckduckgo.com/');

// Returns Open the link https://duckduckgo.com/ of "Open the link https://duckduckgo.com/" | undefined.
fixed.value;

Variables.prototype.variable

The getarrow-up-right accessor returns the variable in form {variable name}, a primitive value of a specified Variable object.

Returns

The return value is the variable of a generic type variable Name on the template {${Name}}.

Example usage

[Symbol.toStringTag]

The property, with the help of toStringTag, changes the default tag to 'variable' for an instance of Variable. It can be read by the typeOf() function of @angular-package/type.

Example usage

Last updated