AngularJS在使用的过程中ng-include失效
代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://apps.bdimg.com/libs/angular.js/1.2.15/angular.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="A">
<div ng-include="va">{{va}}</div>
</body>
</html>
被引用的代码如下
<h1>hello world</h1>
要注意单引号。引用官方API:
angular expression evaluating to URL. If the source is a string constant, make sure you wrap it in single quotes, e.g. src="'myPartialTemplate.html'"