mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Merge pull request #7866 from WesleySSmith/underscore-variable
underscore.ts: Add "variable" to TemplateSettings.
This commit is contained in:
commit
669e1b73f1
@ -436,6 +436,7 @@ var template2 = _.template("Hello {{ name }}!");
|
||||
template2({ name: "Mustache" });
|
||||
_.template("Using 'with': <%= data.answer %>", oldTemplateSettings)({ variable: 'data' });
|
||||
|
||||
_.template("Using 'with': <%= data.answer %>", { variable: 'data' })({ answer: 'no' });
|
||||
|
||||
_(['test', 'test']).pick(['test2', 'test2']);
|
||||
|
||||
|
||||
6
underscore/underscore.d.ts
vendored
6
underscore/underscore.d.ts
vendored
@ -39,6 +39,12 @@ declare module _ {
|
||||
* Default value is '/<%-([\s\S]+?)%>/g'.
|
||||
**/
|
||||
escape?: RegExp;
|
||||
|
||||
/**
|
||||
* By default, 'template()' places the values from your data in the local scope via the 'with' statement.
|
||||
* However, you can specify a single variable name with this setting.
|
||||
**/
|
||||
variable?: string;
|
||||
}
|
||||
|
||||
interface Collection<T> { }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user