我已经实现了一个代码来从html代码中删除指令名称。以下是我的指示
.directive('removeFixedHeader',[
'$compile',
function($compile){
return{
scope: {
idToRemove: "@removeFixedHeader"
},
link: function (scope, elem, attrs) {
elem.on('click', function () {
var elem = angular.element(document.getElementById(scope.idToRemove));
var newHtml ='<div class="partialInner col-md-12 col-xs-12 col-sm-12" id="callCenterFixedHeader">' + '<ng-include src="\'innerMain.html\'"/>'+ '</div>';
$compile(newHtml)(scope, function (el) {
elem.replaceWith(el);
});
});
}
}
}
])
我在这里遇到的问题是innerMain.html的内容无法正常显示
感谢任何建议