以下是我的代码。不确定为什么ng-repeat显示完全空白。
非常感谢任何帮助。
拉里
<!DOCTYPE html>
<html>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<ul><li ngrepeat="x in names">{{x}}</li></ul> </div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil","Tobias","Linus"];
});
</script>
</body>
</html>
答案 0 :(得分:0)
修正拼写错误
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"> </script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<ul><li ng-repeat="x in names">{{x}}</li></ul> </div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil","Tobias","Linus"];
});
</script>
</body>
</html>