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

Was this helpful?

  1. Wrapper
  2. Wrap

Wrap() constructor

PreviousStatic methodsNextInstance methods

Last updated 3 years ago

Was this helpful?

Wrap()

Creates a new instance of the with the opening and closing.

wrap.class.ts
constructor(opening: Opening, closing: Closing) {
  super(Wrap.template`${opening}${closing}`);
  this.#closing = closing;
  this.#opening = opening;
}

Parameters

Name: type
Description

opening: Opening

closing: Closing

Returns

The return value is a new instance of with the primitive value of the provided opening and closing if set properly, otherwise with an empty .

Usage

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

// Returns Wrap{'[]'}
new Wrap('[', ']');

// Returns Wrap{''}
new Wrap(null as any, null as any);

The wrap opening of a generic type variable .

The wrap closing of a generic type variable .

Wrap
Wrap
string
Opening
Closing