// 异步加载模板并编译
$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);
	});

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2021-05-24
  • 2022-02-08
  • 2021-09-05
  • 2022-03-09
  • 2021-12-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
相关资源
相似解决方案