lib/features/src/questions/questionnaire/question-label/question-label.component.ts
selector | rcc-question-label |
styleUrls | ./question-label.component.scss |
templateUrl | ./question-label.component.html |
Properties |
|
Methods |
constructor(question: Question)
|
||||||
Parameters :
|
ngAfterViewInit |
ngAfterViewInit()
|
Inherited from
ExposeTemplateComponent
|
Defined in
ExposeTemplateComponent:14
|
Returns :
void
|
Public question |
Type : Question
|
Public itemLabelTemplate |
Type : TemplateRef<any>
|
Decorators :
@ViewChild(TemplateRef, {static: true})
|
Inherited from
ExposeTemplateComponent
|
Defined in
ExposeTemplateComponent:12
|
import { Component } from '@angular/core'
import { Question } from '@rcc/core'
import { ExposeTemplateComponent } from '@rcc/common'
@Component({
selector: 'rcc-question-label',
templateUrl: './question-label.component.html',
styleUrls: ['./question-label.component.scss'],
})
export class QuestionLabelComponent extends ExposeTemplateComponent{
constructor( public question: Question){ super() }
}
<ng-template>
<h3
class ="ion-text-wrap"
[id] = "question.id | toID:'rcc-e2e'"
>
{{question | translate}}
<span *ngIf = "question.unit">
({{question.unit}})
</span>
</h3>
<p>
{{ question.min ? 'min: '+question.min :'' }}
{{ question.min ? 'max: '+question.max :'' }}
<span
*ngFor =" let option of (question | labeledOptions); last as $last"
[class] = "question.id + '-' + question.type | toID:'rcc-e2e'"
>
{{ option | translate }}{{$last ? '' : ', '}}
</span>
</p>
</ng-template>
./question-label.component.scss