3
我是新来的Angular,并试图显示数据使用控制器,但它没有显示..我认为我犯了一些愚蠢的错误,数据不会出现错误。角度数据绑定不显示数据..
这里是JS:
(function() {
'use strict';
var app = angular.module('empapp', []).controller('emplcontroller', ['$scope', function ($scope) {
$scope.empdatateamdynamo = [
{
name: 'name will be here',
profilepic: 'image will be here',
designation: 'designation will be here',
teamname: 'team will be here'
},
{
name: 'name will be here',
profilepic: 'image will be here',
designation: 'designation will be here',
teamname: 'team will be here'
},
{
name: 'name will be here',
profilepic: 'image will be here',
designation: 'designation will be here',
teamname: 'team will be here'
}
]
}]);
})();
HTML是在这里:
<body ng-app="empapp">
<div class="container" ng-controller="emplcontroller">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4" ng-repeat="items in empdatateamdynamo">
<h2> {{ empdatateamdynamo.name }}</h2>
<p> {{ empdatateamdynamo.profilepic }} </p>
<p> {{ empdatateamdynamo.designation }} </p>
<p><a class="btn btn-default" href="#" role="button"> {{ empdatateamdynamo.teamname}}</a></p>
</div>
</div>
</div>
</body>
谢谢Pankaj ..它的工作.. – kuldeepsingh23
@ kuldeepsingh23很高兴知道这一点。谢谢:) –
哦,是的,我的错误..它对我的工作很好,谢谢.. – kuldeepsingh23