SQ-UI/ng-sq-ui

View on GitHub
projects/ng-form-elements/src/lib/input/input.component.ts

Summary

Maintainability
A
0 mins
Test Coverage
B
87%
import {
  Component, OnInit, ViewEncapsulation, forwardRef,
  Input } from '@angular/core';
import { InputCoreComponent } from '@sq-ui/ng-sq-common';
import { NG_VALUE_ACCESSOR } from '@angular/forms';

const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
  provide: NG_VALUE_ACCESSOR,
  useExisting: forwardRef(() => InputComponent),
  multi: true
};

@Component({
  selector: 'sq-input',
  templateUrl: './input.component.html',
  styleUrls: ['./input.component.scss'],
  encapsulation: ViewEncapsulation.None,
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
})
export class InputComponent extends InputCoreComponent implements OnInit {
  @Input() type: string = 'text';

  constructor() {
    super();
  }

  ngOnInit() {

  }
}