本文整理汇总了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);
}
}