$compile的妙用

$compile将js生成的HTML中注入$scope,那样就可以在生成的HTML中使用angular

var maphtml = $('#allmap1');
$compile(maphtml)($scope);

posted @ 2018-02-07 16:19  cacti_vc  阅读(222)  评论(0编辑  收藏  举报