AngularJS简单问题。求大神帮我看下,为什么总是显示不出结果?我找不到原因,哭
<htmlng-app><head><scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/a...
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="controllers.js"></script>
</head>
<body>
<tb ng-controller='AlbumController'>
<tr ng-repeat = 'track in Ablum'>
<td>{{track.name}}</td>
<td>{{track.duration}}</td>
</tr>
<tb>
<script>
var Ablum = [{name:'jack', duration:'12:19'},
{name:'test',duration:'12:20'},
{name:'why',duration:'14:32'}];
function AlbumController($scope){
$scope.Ablum = Ablum;
}
</script>
</body>
</html> 展开
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="controllers.js"></script>
</head>
<body>
<tb ng-controller='AlbumController'>
<tr ng-repeat = 'track in Ablum'>
<td>{{track.name}}</td>
<td>{{track.duration}}</td>
</tr>
<tb>
<script>
var Ablum = [{name:'jack', duration:'12:19'},
{name:'test',duration:'12:20'},
{name:'why',duration:'14:32'}];
function AlbumController($scope){
$scope.Ablum = Ablum;
}
</script>
</body>
</html> 展开
2个回答
展开全部
<!DOCTYPE html>
<html ng-app="test">
<head>
<title>test</title>
</head>
<body>
<table ng-controller="AlbumController">
<tr ng-repeat="track in Ablum">
<td>{{track.name}}</td>
<td>{{track.duration}}</td>
</tr>
<table>
<script type="text/javascript" src="./angular.min.js"></script>
<script>
var app = angular.module('test', []);
app.controller('AlbumController', function($scope){
$scope.Ablum = [
{name:'jack', duration:'12:19'},
{name:'test',duration:'12:20'},
{name:'why',duration:'14:32'}
];
});
</script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询