angularjs异步请求html并编译
// 异步加载模板并编译
$templateRequest("views/common/test.html").then(function(html) {
// Step 1: parse HTML into DOM element
var template = angular.element(html);
// Step 2: compile the template
var linkFn = $compile(template);
// Step 3: link the compiled template with the scope.
var element = linkFn($scope);
// Step 4: Append to DOM (optional)
angular.element("#test").append(element);
});

浙公网安备 33010602011771号