I am new to angularjs currently I am learning how to read array objects and display in view.
HTML Code:
<body ng-app="myDirective" ng-controller="myController">
<div class="container border_bottom">
{{welcomeMessage}}<br />
<label>First Name</label> : {{fullname.firstName}}<br />
<label>Last Name</label> : {{fullname.LastName}}<br />
Employee Details <br />
<ul>
<li ng-repeat="emp in employee">
<div>
<label>Employee ID</label>{{employee.empId}}<br/>
<label>Employee Name</label>{{employee.empName}}<br/>
<label>Voter Count</label>{{employee.voteCount}}
</div>
</li>
</ul>
</div>
AngularJS Code:
var myApp = angular.module("myDirective", []);
myApp.controller("myController", function ($scope) {
$scope.welcomeMessage = "Hello ";
$scope.fullname = { firstName: "Mahadevan", LastName: "Sivasubramanian" }
$scope.employee = [
{ empId: 1, empName: "Mahadevan", voteCount: 0 },
{ empId: 2, empName: "john", voteCount: 0 },
{ empId: 3, empName: "Siva", voteCount: 0 }
];
});
I am not getting any error. Where I am doing mistake?