當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。