Home > OS >  Can't read data from JSON file
Can't read data from JSON file

Time:10-13

Please I have a problem here. I can't read the data from a JSON file:

<i>{{ exform.get('firstname').hasError("required") ? "{{ 'hospitaladmin.firstname.error.required' | translate }}" : '' }}</i>

But here it works:

 placeholder="{{ 'hospitaladmin.search' | translate }}"

Any idea about it?

CodePudding user response:

Just rewrite your expression a little bit to keep things simple:

<i>{{ exform.get('firstname').hasError("required") ? (hospitaladmin.firstname.error.required | translate) : '' }}</i>

And for your placeholder:

[placeholder]="hospitaladmin.search | translate"
  • Related