ngOnInit method

  1. @override
void ngOnInit()
override

Executed after the first change detection run for a directive.

See OnInit for a full description.

Implementation

@override
void ngOnInit() {
  if (isRequired) input.setAttribute('required', '');
  if (!searchable) input.setAttribute('readonly', '');

  input.onFocus.listen((ev) => _onFocus());
  input.onBlur.listen((ev) => _onBlur(true));
}