newbie
newbie

Reputation: 156

Can't read data from JSON file

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?

Upvotes: 1

Views: 64

Answers (1)

pzaenger
pzaenger

Reputation: 11992

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"

Upvotes: 4

Related Questions