29 lines
647 B
TypeScript
29 lines
647 B
TypeScript
import { Component, Input } from '@angular/core';
|
|
import { FormErrorEncoder } from '../utils';
|
|
import { ResourceService } from '../services';
|
|
|
|
/**
|
|
* A validated field that enables a user to enter the
|
|
* human name. The name will be available through the
|
|
* components name which also acts as an input.
|
|
*/
|
|
@Component({
|
|
selector: 'app-name-field',
|
|
templateUrl: './name-field.component.html'
|
|
})
|
|
export class NameFieldComponent extends FormErrorEncoder {
|
|
|
|
/**
|
|
* The human name
|
|
*/
|
|
@Input() name: string;
|
|
/**
|
|
* Disables the field.
|
|
*/
|
|
@Input() disabled: boolean;
|
|
|
|
constructor(public res: ResourceService) {
|
|
super();
|
|
}
|
|
}
|