可以查看代码 http://jsfiddle.net/hh1mye5b/1/
或
<!doctype html>
<html ng-app="dcApp">
<head>
</head>
<body>
<div>
<div ng-controller="SpeciesController">
<label><h2>{{name}}</h2></label>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script>
<script>
var dcApp = augular.module("dcApp", [])
dcApp.controller("SpeciesController",
function ($scope) {
$scope.name="Hello World"
});
</script>
</body>
</html>
我尝试使用angularJS在{{name}}
中显示<h2>
,然而,我发现它没有用。有没有人有这方面的想法?
答案 0 :(得分:5)
因为您使用了augular
而不是angular
var dcApp = augular.module("dcApp", [])
// here -----^