AbsaOSS / cps-shared-ui

Angular shared components library
https://absaoss.github.io/cps-shared-ui/
Apache License 2.0
2 stars 2 forks source link

Retrieve default values for the Input properties defined using setters/getters #337

Closed lukasmatta closed 5 months ago

lukasmatta commented 7 months ago

Currently, if the input property is defined using the setter/getter, no default value is available in the docs. For each such input property, we should add a @default annotation, indicating the default value of the related private property. Modification of the generator is also required to retrieve the default value correctly.

E.g.

/**
 * Sample input value.
+ * @default 'Some random sample value'
 * @group Props
 */
@Input() set value(value: string) {
  this._value = value;
}

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

private _value = 'Some random sample value';