import { Component , OnInit } from '@angular/core' ; import { RenderFieldComponent } from '../components.fields' ; @ Component ( { templateUrl : './checkbox.component.html' , styleUrls : [ './checkbox.component.scss' ] } ) export class CheckboxComponent extends RenderFieldComponent implements OnInit { public namePrefix : string = 'dummy_' ; public constructor ( ) { super ( ) ; this . namePrefix = `${ Math . random ( ) . toString ( 36 ) . slice ( - 8 ) }_` ; } ngOnInit ( ) { this . controller . setValue ( this . controller . value || false , { onlySelf : true } ) ; } }