windows-8 – 使用AngularJS for Windows Store App“无法添加动
发布时间:2020-12-14 02:05:07 所属栏目:Windows 来源:网络整理
导读:我正在使用AngularJS创建一个 Windows应用商店应用(或城域应用,或者他们称之为的任何应用). 我解决了Javascript RunTime错误“无法添加动态内容”崩溃应用程序(见here),一切顺利,直到我开始使用指令(undestand angular.module.directive). 现在,我有一个“无
我正在使用AngularJS创建一个
Windows应用商店应用(或城域应用,或者他们称之为的任何应用).
我解决了Javascript RunTime错误“无法添加动态内容”崩溃应用程序(见here),一切顺利,直到我开始使用指令(undestand angular.module.directive). 现在,我有一个“无法添加动态内容”但在控制台日志中.请注意,应用程序不会崩溃,事实上,应用程序按预期工作! 我应该忽略错误(我不喜欢),我可以做些什么吗? 一个“时钟”应用程序的代码来说明: 谢谢, index.html的: <!doctype html> <html lang="en" ng-app="phonecat"> <head> <meta charset="utf-8"> <title>Google Phone Gallery</title> <link rel="stylesheet" href="css/app.css"> <link rel="stylesheet" href="css/bootstrap.css"> <script src="lib/jquery-1.8.2-win8-1.0.min.js"></script> <script type="text/javascript"> jQuery.isUnsafe = true; </script> <script src="lib/angular/angular.js"></script> <script src="js/app.js"></script> <script src="js/controllers.js"></script> <script src="js/filters.js"></script> <script src="js/services.js"></script> <script src="lib/angular/angular-resource.js"></script> </head> app.js angular.module('phonecat',['phonecatFilters','phonecatServices']).config(['$routeProvider',function($routeProvider) { $routeProvider. when('/phones',{templateUrl: 'partials/phone-list.html',controller: PhoneListCtrl}). otherwise({redirectTo: '/phones'}); }]) .directive('myCurrentTime',function($timeout,dateFilter) { return { restrict: 'E',replace: true,template: '<div> Current time is: <span>{{time}}</span></div>',link: function (scope,element,attrs) { var timeoutId; function updateTime() { scope.time = dateFilter(new Date(),'M/d/yy h:mm:ss a'); } function updateLater() { timeoutId = $timeout(function () { updateTime(); updateLater(); },1000); } element.bind('$destroy',function () { $timeout.cancel(timeoutId); }); updateLater(); } } }); 错误: HTML1701: Unable to add dynamic content '<my-current-time></my-current-time> '. A script attempted to inject dynamic content or elements previously modified dynamically that might be unsafe. For example,using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content or explicitly create elements and attributes with a method such as createElement. For more information,see http://go.microsoft.com/fwlink/?LinkID=247104. File: index.html 解决方法
这是窗口商店应用程序的安全性.
您可以使用以下 script修复它. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 在XP系统下安装IIS6.0步骤分享
- winapi – WIN32上struct __stat64和struct _stati64有什么
- windows – 有什么方法可以在Vista X64上本地播放quicktime
- windows-7 – X11桌面与服务器上Win7 VM guest虚拟机的virt
- 未来的Windows Server路线图?
- windows-server-2003 – 远程桌面没有响应的最常见原因?
- 批处理文件 – 如何以DOS方式输入内容?
- windows-server-2008-r2 – netsh设置多个hostednetwork
- 创建.NET Windows服务安装程序的最佳方法是什么?
- remote-desktop – 如何禁用Administrator的RDP访问权限
推荐文章
站长推荐
- windows-server-2008-r2 – Server 2008 R2 KMS服
- 如何用R获取Windows机器的磁盘空间?
- 在Windows上进行Qt dll部署
- 如果结构定义了uint16_t字和uint8_t字节,则数组的
- windows – 在PowerShell中写入包含多个作业的文
- windows-vista – 用于Vista 64位的RAM磁盘
- .net – Task <>和IAsyncOperation <>
- Windows API一日一练 10 LoadAccelerators函数
- .net – WCF Windows Service TimeOut
- 如何在Windows系统中打开特定的端口号
热点阅读