import { Component , Input , ChangeDetectionStrategy , TemplateRef , ElementRef , Renderer2 , OnInit } from '@angular/core' ; import { InputBoolean } from '../util/convert' ; @ Component ( { selector : 'label[nglFormLabel]' , templateUrl : './label.html' , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class NglFormLabel implements OnInit { @ Input ( 'nglFormLabel' ) label : string | TemplateRef < any > ; @ Input ( 'nglFormLabelClass' ) klass = 'slds-form-element__label' ; @ Input ( ) @ InputBoolean ( ) required : boolean ; constructor ( private element , private renderer ) { } ngOnInit ( ) { this . renderer . addClass ( this . element . nativeElement , this . klass ) ; } }