Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractDorfFieldComponent<T, M>

Base for each DORF field. @Component() annotation should be set on the subclass level and then no more annotations should be presented (e.g. no @Input() or @Output() on properties). If there is no way to go without additional annotations in subclass, metadata should be listed directly in the subclass once again, with the corresponding @Input annotation.

example

 //
 @Component({
   moduleId: module.id,
   selector: "star",
   styleUrls: ["star-rating.component.css"],
   templateUrl: "star-rating.component.html"
 })
 export class StarRatingComponent<T> extends AbstractDorfFieldComponent<T, StarRatingMetadata<T>> implements IStarRatingDefinition<T> {

   constructor(config: DorfConfigService) {
     super(config);
   }

   setValue(val: number) {
     this.formControl.setValue(val + 1);
   }

   get max() { return this.metadata.max; }

   get stars() { return new Array(this.max); }
   get value() { return this.formControl.value; }
 }
stable

Type parameters

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

config

injected service

metadata

metadata: M

Essence, needed by DORF field.

Accessors

formControl

  • get formControl(): FormControl

htmlFieldCss

invalid

  • get invalid(): undefined | true | false

key

  • get key(): string

label

  • get label(): undefined | string

labelCss

  • get labelCss(): string

Methods

Protected getCss

Generated using TypeDoc