当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript knockout.applyBindingsToNode函数代码示例

本文整理汇总了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);
     }
     
 }
开发者ID:saeed-ahmed,项目名称:CCTracking,代码行数:14,代码来源:PaymentView.ts

示例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);
 }
开发者ID:ocdsoft,项目名称:TypeScriptKnockoutSample,代码行数:11,代码来源:knockout-bindinghandlers.ts

示例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);
        });
开发者ID:paperbits,项目名称:paperbits-demo,代码行数:12,代码来源:blogPublisher.ts

示例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);
        });
开发者ID:paperbits,项目名称:paperbits-demo,代码行数:17,代码来源:pagePublisher.ts

示例5: setOptionDisable

 setOptionDisable(option, item) {
     if (item.id == 1) {
         ko.applyBindingsToNode(option, { disable: true, text: item.description + ' - Maintenance' }, item);
     }
 }
开发者ID:kashifjawed,项目名称:CCTracking,代码行数:5,代码来源:BusVisitView.ts

示例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);
     }
 }
开发者ID:kashifjawed,项目名称:CCTracking,代码行数:5,代码来源:PaymentView.ts


注:本文中的knockout.applyBindingsToNode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。