我们正在开发一个基于角度js的工作灯应用程序。所以角js有一个“指令”,它从html文件返回一段HTML代码并注入main.html我们在这里观察到的是,每当有一个空格/注释等在HTML标签元素之外时,它会抛出错误代码为“https://docs.angularjs.org/error/ $ compile/tplrt” 这是一个已知问题并记录在角度文档中。Worklight with Angular js
但奇怪的是,我们从WL 6.1开始开发,从未遇到过这个问题。一旦我们迁移到WL 6.2,就会弹出此错误。我想到的其中一件事是默认的jquery lib(冲突),它与worklight捆绑在一起。但我试图用较旧的jquery版本替换(直到1.9.1)并且它不起作用。任何想法/建议为什么这可能会发生在6.2?
PS:此问题仅在浏览器中出现,而不在仿真器/设备中。
的index.html
<body style="display: none;">
<!--application UI goes here-->
<shell></shell>
</body>
<script src="js/lib/angular.js"></script>
<script src="js/shell.js"></script>
main.js
// Common initialization code goes here
angular.bootstrap(document, ['shell']);
shell.html
<div id="topZone" app-view-segment="0"></div>[Insert \n here]
shell.js
angular.module('shell',[]);
angular.module('shell').directive('shell', [
function() {
console.log('shell Directive');
return {
restrict: 'EA',
replace: true,
templateUrl: 'views/shell.html'
};
}]);
你有什么更实质的展示吗?提供复制项目或重现步骤。 – 2014-10-07 07:02:46
嗨伊丹,编辑我的问题。 – 2014-10-07 08:23:11