Created
May 5, 2014 17:22
-
-
Save Shawful/11542533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta name="description" content="testing for app JSON ng-repeat problem" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app="app"> | |
<div ng-controller="repCtrl"> | |
<div ng-repeat="rep in reps" | |
<p>{{rep.name}}</p> | |
</div> | |
There are {{reps.length}} reps. | |
<p>The first rep is :<br> | |
{{reps[0]}}</p> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('app',[]); | |
app.controller('repCtrl',['$scope', function($scope){ | |
$scope.reps = [{ | |
name: "Michael", | |
role: "Rep" | |
}, { | |
name: "Ted", | |
role: "Senator" | |
}, { | |
name: "John", | |
role: "Senator" | |
}]; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment