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