Angularjs $compile自升级到Angular 1.3后一直不工作

Angularjs $compile自升级到Angular 1.3后一直不工作,angularjs,migration,Angularjs,Migration,我已升级到Angular 1.3.15,以下代码停止正常工作: var newScope = $scope.$new(); angular.extend(newScope, data); var html = '<ng-include src=\'"' + templateUrl + '"\'></ng-include>'; var newHtml = $compile(html)(newScope); var newScope=$scope.$new(); 角度扩展(

我已升级到Angular 1.3.15,以下代码停止正常工作:

var newScope = $scope.$new();
angular.extend(newScope, data);
var html = '<ng-include src=\'"' + templateUrl + '"\'></ng-include>';
var newHtml = $compile(html)(newScope);
var newScope=$scope.$new();
角度扩展(新闻镜、数据);
var html='';
var newHtml=$compile(html)(新闻范围);
$compile
之后,
newHtml
的数据是
数据:“ngInclude:undefined”
。 我试着查看可能出现在1.2或1.3中的破坏性更改,但没有发现任何相关内容

想法

[编辑]

在线阅读更多示例后,例如:

我看到,当我在旧的AngularJS版本中运行这段代码时,我得到一个返回元素
ng include.ng scope
,而在新版本中我得到
comment
。 如果它添加了两个元素——comment和ng include,那么这是有意义的,但是它没有,只有comment。
不知道如何从这里继续下去,不太清楚为什么,但我通过动态创建一个div元素,注入其html并将其传递给$compile来解决这个问题

像这样:

var html = "<ng-include src=\"'" + templateUrl + "'\"></ng-include>";
var div = $('<div>');
div.html(html);
var newHtml = $compile(div)(newScope);
var html=”“;
var div=$('');
div.html(html);
var newHtml=$compile(div)(新闻范围);

我不知道这是否相关,但为什么在
templateUrl
周围需要单引号和双引号?以指示这是我目录中的路径,而不是完整路径或web url。顺便说一句,这段代码在Angular 1.1中运行得非常好,我想您可能没有用引号包装templateUrl,比如
src=“'myPartialTemplate.html'”
。尝试
var html=''它归结为:
@yarons很乐意透露。试过了,还是一样的效果。