I am new to angular js and I'm having an issue. My repeat code is
<div id="list" ng-controller="Controller">
<ul class="list-group">
<li class="list-group-item" ng-repeat="item in username">
<div>
<h2 class="list-group-item-heading">{{item.name}}</h2>
<h3 class="list-group-item-heading">{{item.un}}</h3>
</div>
</li>
</ul>
</div>
And my controller is :
var myApp = angular.module('myApp',[]);
myApp.controller('Controller',function Controller($login) {
$login.username=[
{
"name":"Dr. Sarfaraz",
"un":"[email protected]",
"pass":"12345212e2"
},
{
"name":"Dr. Abdullah",
"un":"[email protected]",
"pass":"13e45212e2"
},
{
"name":"admin",
"un":"[email protected]",
"pass":"*2345*12e2"
}
]; });
When I run this code, the data is not populated from the list. Can anybody help me to solve this problem....:)
console?$loginshould be$scope, or['$scope', function Controller($login){, or useas syntaxandthis.username=[