Skip to main content
Template.render method

Applies to Windows and Windows Phone

Binds values from the specified data context to elements that are descendants of the specified root element that have the declarative binding attributes specified (data-win-bind).

Syntax


template.render(dataContext, container).done( /* Your success and error handlers */ );

Parameters

dataContext

Type: object

The object to use for default data binding.

container

Type: DOMElement

The element to which to add this rendered template. If this parameter is omitted, a new DIV is created.

Return value

Type: Promise

A Promise that will be completed after binding has finished. The value is either container or the created DIV. promise that is completed after binding has finished.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Binding

Library

Base.js

See also

Template