import { Attribute , Directive , ElementRef , Input , Renderer } from '@angular/core' ; import { Config } from '../../config/config' ; import { Ion } from '../ion' ; name description property property property usage demo see {@link ../../../../components#inputs Input Component Docs} see {@link ../../input/Input Input API Docs} @ Directive ( { selector : 'ion-label' } ) export class Label extends Ion { private _id : string ; hidden type : string ; constructor ( config , elementRef , renderer , @ Attribute ( 'floating' ) isFloating , @ Attribute ( 'stacked' ) isStacked , @ Attribute ( 'fixed' ) isFixed , @ Attribute ( 'inset' ) isInset ) { super ( config , elementRef , renderer , 'label' ) ; this . type = ( isFloating === '' ? 'floating' : ( isStacked === '' ? 'stacked' : ( isFixed === '' ? 'fixed' : ( isInset === '' ? 'inset' : null ) ) ) ) ; } hidden @ Input ( ) get id ( ) : string { return this . _id ; } set id ( val ) { this . _id = val ; if ( val ) { this . setElementAttribute ( 'id' , val ) ; } } hidden get text ( ) : string { return this . getNativeElement ( ) . textContent || '' ; } }