Tag
PackagesTwitterGitHub
  • Introduction
  • General concepts
  • Getting started
    • Skeleton
    • Installation
    • Public API
  • Attribute
    • Code
    • Attribute {}
    • Generic type variables
    • ★ Attribute() constructor
    • Instance
      • Accessors
        • attribute
        • name
        • value
        • [Symbol.toStringTag]
      • Properties
        • #name
        • #value
      • Methods
        • toArray()
        • toObject()
        • toString()
        • valueOf()
    • Static
      • Methods
        • isAttribute()
    • Usage
  • Attributes
    • Attributes {}
    • Generic type variables
    • Instance
      • Accessors
      • Properties
    • Attributes() constructor
    • Instance methods
    • Usage
  • Tag
    • Tag {}
    • Usage
  • Tag Extension
    • TagExtension {}
    • Usage
  • tags
    • Tags {}
    • Usage
  • BBCode
    • BBCode {}
    • Usage
  • Html
    • HTML {}
    • Usage
  • Variable
    • Variable {}
    • Usage
  • Variables
    • Variables {}
    • Usage
  • Types
    • ClosingTag
    • OpeningTag
    • TaggedText
  • License
    • MIT
  • Contact
    • ⋯ Chat
    • @ Email
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
Powered by GitBook
On this page
  • Attribute.prototype.toObject()
  • Returns
  • Example usage

Was this helpful?

Edit on GitHub
  1. Attribute
  2. Instance
  3. Methods

toObject()

Attribute.prototype.toObject()

Returns attribute primitive value converted to the object where the property key is the attribute name, and property value is the attribute value.

attribute.class.ts
public toObject(): Readonly<{ [key in Name]: Value }> {
  return Object.freeze({
    [this.#name]: this.#value,
  }) as { [key in Name]: Value };
}

Returns

The return value is the attribute of a read-only object.

Example usage

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

PrevioustoArray()NexttoString()

Last updated 3 years ago

Was this helpful?