本文整理匯總了TypeScript中knockout.applyBindingsToNode函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript applyBindingsToNode函數的具體用法?TypeScript applyBindingsToNode怎麽用?TypeScript applyBindingsToNode使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了applyBindingsToNode函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setOptionDisable
setOptionDisable(option, item) {
//alert('after render');
//debugger;
var modifiedDesc = item.description;
if (item.description.indexOf('Booked - Paid') >= 0 || item.description.indexOf('Booked - Unpaid') >= 0) {
modifiedDesc = item.description;
ko.applyBindingsToNode(option, { disable: true, text: modifiedDesc }, item);
}
if (item.isOnMaintainance) {
modifiedDesc = item.description + ' - Maintenance';
ko.applyBindingsToNode(option, { disable: true, text: modifiedDesc }, item);
}
}
示例2: function
init: function (element, valueAccessor, allBindings, viewModel) {
var value = valueAccessor();
var message = ko.unwrap(value.message);
var click = value.click;
ko.applyBindingsToNode(element, {
click: function () {
if (confirm(message))
return click.apply(this, Array.prototype.slice.apply(arguments));
}
}, viewModel);
}
示例3: Promise
const buildContentPromise = new Promise(async (resolve, reject) => {
this.routeHandler.navigateTo(post.permalink);
const layoutViewModel = await this.layoutViewModelBinder.getLayoutViewModel();
ko.applyBindingsToNode(templateDocument.body, { widget: layoutViewModel }, null);
setTimeout(() => {
this.setSiteSettings(templateDocument, settings, iconFile, post);
htmlContent = "<!DOCTYPE html>" + templateDocument.documentElement.outerHTML;
resolve();
}, 10);
});
示例4: setTimeout
const buildContentPromise = new Promise<void>(async (resolve, reject) => {
this.routeHandler.navigateTo(page.permalink);
const layoutViewModel = await this.layoutViewModelBinder.getLayoutViewModel();
ko.applyBindingsToNode(templateDocument.body, { widget: layoutViewModel }, null);
if (page.ogImageSourceKey) {
imageMedia = await this.mediaService.getMediaByKey(page.ogImageSourceKey);
}
this.setSiteSettings(templateDocument, settings, iconMedia, imageMedia, page, page.permalink);
setTimeout(() => {
htmlContent = "<!DOCTYPE html>" + templateDocument.documentElement.outerHTML;
resolve();
}, 10);
});
示例5: setOptionDisable
setOptionDisable(option, item) {
if (item.id == 1) {
ko.applyBindingsToNode(option, { disable: true, text: item.description + ' - Maintenance' }, item);
}
}
示例6: setOptionDisable
setOptionDisable(option, item) {
if (item.description.indexOf('Booked - Paid') >= 0 || item.description.indexOf('Booked - Unpaid') >= 0) {
ko.applyBindingsToNode(option, { disable: true, text: item.description}, item);
}
}