学习角度和尝试得到一个非常简单的ng-包括工作。
tempHeader.html包含一行文本,无法显示。
<!DOCTYPE html>
<html ng-app="theApp">
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</head>
<body>
<ng-include src="tempHeader.html"/>
</body>
</html>发布于 2014-10-08 18:35:08
ng-include需要一个变量,所以必须用引号包装字符串:
<ng-include src="'tempHeader.html'"/>或者设置一个变量并使用该变量:
$scope.url = "tempHeader.html";
<ng-include src="url"/>https://stackoverflow.com/questions/26263881
复制相似问题