Last active
October 12, 2016 10:21
-
-
Save RomkeVdMeulen/a81a86d61f776c89c48770729ed65dd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function translation(textkey: string) { | |
if (!textkey) { | |
throw "Parameter textkey is required with the @translation decorator"; | |
} | |
return (target: any, property: string) => { | |
translationService().getTranslation(textkey) | |
.then(text => target[property] = text); | |
} | |
} | |
export function translationPromise(textkey: string) { | |
if (!textkey) { | |
throw "Parameter textkey is required with the @translationPromise decorator"; | |
} | |
return (target: any, property: string) => target[property] = textService().getText(textkey); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment