Issue
here I have code,where i got error message as "Invalid phone number" but I need to add country which is variable after the first letter in text.How can i do it.
<p *ngIf="!result" class="error-msg"> {{'REGISTER.ERROR'| translate}}</p>
Solution
I can see you are using ngxtranslate you should have mentioned that in the question for better under standing to get text in middle of variable dinamically something like "Invalid India phone number" then in translate json file you have to mention
"REGISTER":{
"ERROR":"Invalid {{value}} phone number"
}
and in html
<p *ngIf="!result" class="error-msg"> {{'REGISTER.ERROR'| translate:param }}</p>
in ts
param={
value:"India"
}
i hope your issue got resolved happy coding
Answered By - sai kiran
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.