Skip to content

0.2.0 interface IContext

Ivan S Glazunov edited this page Feb 20, 2015 · 4 revisions

interface IContext { [name: string]: TData; };

Describes the interface to the execution context rendering.

var context: IContext = {
	type: 'name',
	data: function(callback) { callback('Example'); },
	person: {
		whose: function() { return 'my'; }
	}
};
Templates._stringTemplate('<%= person.whose %> <%= type %>: <%= name %>', context, console.log);
// my name: Example
Clone this wiki locally