【发布时间】:2017-04-25 07:11:44
【问题描述】:
我尝试使用 angular 将字符串变量转换为 html,我收到 $compile 组件建议但出了点问题
我的控制器:
ChatZamba.controller("ScriptController", ['$scope', '$compile', function ($scope, $timeout, $compile) {
还有我的角度函数:
function build_step_view(data, i){
if(data != undefined){
var tmp = $compile($('.detail-script-list'))(scope);
$('.detail-script-list').append(tmp);
}
}
但是当触发我的函数时,我在 Chrome 编译器中得到TypeError: $compile is not a function。
帮帮我!谢谢!
【问题讨论】:
标签: angularjs