Issue
String.Format
does not work in TypeScript
.
Error:
The property 'format' does not exist on value of type '{ prototype: String; fromCharCode(...codes: number[]): string; (value?: any): string; new(value?: any): String; }'.
attributes["Title"] = String.format(
Settings.labelKeyValuePhraseCollection["[WAIT DAYS]"],
originalAttributes.Days
);
Solution
You can declare it yourself quite easily:
interface StringConstructor {
format: (formatString: string, ...replacement: any[]) => string;
}
String.format('','');
This is assuming that String.format is defined elsewhere. e.g. in Microsoft Ajax Toolkit : http://www.asp.net/ajaxlibrary/Reference.String-format-Function.ashx
Answered By - basarat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.