I want to display a translated message when a button is clicked so I need to use the translate pipe in the typescript.
This is my json :
"newRepair": {
"intake": {
"errormessage" : "This is a required field"
}
}
This is the function related to the button in TS :
error : string;
saveAndGoForUpload(){
this.error = this.translatePipe.transform("newRepair.intake.errormessage");}
HTML :
<button (click)="saveAndGoForUpload()" type="button"
class="btn">PROCEED</button>
<p>{{error}}</p>
It gives me this error : NullInjectorError: No provider for TranslatePipe!