Open rakeshgirase opened 6 years ago
Hi @rakeshgirase, Thank you for reporting this issue. I tested this case and indeed this is a real issue and the Span visibility will not be changed dynamically while using the ngIf directive. I am logging this as a bug and for further info, you could keep track on the issue.
+1
@rakeshgirase I'd suggest you creating FormattedString in component and bind it to the Label. Example:
formattedString: FormattedString;
ngOnChanges(changes): void {
if (changes && changes.job && changes.job.currentValue) {
this.formattedString = this.generateValuesFormattedString(changes.job.currentValue);
}
}
generateValuesFormattedString(job: Job): FormattedString {
const formattedString = new FormattedString();
_.each(job.values, (value, i) => {
const titleSpan = new Span();
const answerSpan = new Span();
titleSpan.text = `${value.attribute.title}\n`;
let answer = `${getAnswer(value)}`;
answer += i < (job.values.length - 1) ? '\n\n' : '';
answerSpan.text = answer;
answerSpan.color = new Color('#333333');
formattedString.spans.push(titleSpan, answerSpan);
});
return formattedString;
}
<Label *ngIf="formattedString" textWrap="true" [formattedText]="formattedString"></Label>
Hi @trunkovich Thank you for the workaround. I raised this bug because it is not working as expected and ideally should be fixed.
Still no fix..
still not working
@tsonevn This is still not working, should I create a new issue for this?
For Some reason Angular Ng Directives are not working Following is a code sample:
When you toggle between items where isPractiveMode gives you true and false then the Formatted String becomes longer and longer. Please find the image attached.