|
板凳
楼主 |
发表于 2015-12-11 17:35:26
|
只看该作者
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="angular-1.3.0.js"></script>
</head>
<body>
<div ng-app="myApp">
<div ng-controller="firstController">
<div ng-bind="text"></div>
<div ng-include="url"></div>
</div>
</div>
<script type="text/javascript">
var app = angular.module('myApp',[]);
app.controller('firstController',['$scope',function($scope){
//$scope.text = '<h1>hello</h1>';
$scope.text = 'hello';
$scope.url = 'angular.html';
}]);
</script>
</body>
</html>
这段代码直接运行不了,必须在xampp里面用http://localhost:8080/index才可以运行,我的外部文件angular.js是和它建在一个文件夹下,但就是运行不了 |
|