最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

knockout.js - Knockout secure bindings not working (Durandal) - Stack Overflow

programmeradmin4浏览0评论

I have been trying to apply knockout secure bindings to remove unsafe-eval issues in app. Half of my durandal components have failed to load while doing. Can anyone suggest what is going wrong?

I have applied below code to my knockoutBindings.ts file, it failed to load more than half of the components in Durandal although unsafe-eval issues were not shown in console. The same file has many custom bindings created too which I don't know if causing a conflict with knockout secure binding or if my way of applying knockout-secure-binding is correct

import ksb = require("knockout-secure-binding")

var options = {
  attribute: "data-bind",
  globals : {},
  bindings: ko.bindingHandlers, // still use default binding handlers
  noVirtualElements: true       // no virtual elements
};

ko.bindingProvider.instance = new ksb(options);
发布评论

评论列表(0)

  1. 暂无评论