get template()

The get accessor gets the template of the error message

CommonError.prototype.template

The get accessor gets the template of the error message by returning the #template property of a specified object.

common-error.class.ts
public get template(): string {
  return this.#template;
}

Return type

Returns

The return value is the template of a string type.

Example usage

// Example usage.
import { CommonError } from '@angular-package/error';

// Extend the `CommonError` class.
class TestError<Id extends string> extends CommonError<Id> {}

// Returns "{problem} {fix} {id}".
new TestError(
  'Problem accessor.',
  'Fix accessor.',
  '(AE:427)',
  '{problem} {fix} {id}'
).template;

Last updated