Reputation: 13
Learning angular and trying to get a very simple ng-include to work.
tempHeader.html contains a single line of text, which fails to display.
<!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>
Upvotes: 0
Views: 44
Reputation: 104775
ng-include
expects a variable, so you have to wrap your string in quotes:
<ng-include src="'tempHeader.html'"/>
Or set a variable and use that:
$scope.url = "tempHeader.html";
<ng-include src="url"/>
Upvotes: 1