I'm new to js/html/css etc., and trying to teach myself angular, but I'm stuck on something that seems simple.
When I load the page described below, I get the title and a one item list containing the text that I want angular to replace "{{e.someKey}}". What I'm looking for is two bullets - someValue1 and someValue2.
In index.html:
<!doctype html>
<html lang="en" ng-app="myfirstapp">
<head>
<meta charset="utf-8">
<title>my first app</title>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="lib/angular/angular.js"></script>
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
</head>
<body>
<h1>My First App</h1>
<div ng-controller="MyFirstAppController">
<ul>
<li ng-repeat="e in elementArray">
<p>{{e.someKey}}</p>
</li>
</ul>
</div>
</body>
</html>
The controller looks like this:
function MyFirstAppController($scope) {
$scope.elementArray = [
{ someKey : 'someValue1', someOtherKey : 'someOtherValue1' },
{ someKey : 'someValue2', someOtherKey : 'someOtherValue2' }
];
}
I've tried loads of syntax tweaks to this, but I must be missing something more fundamental. Any ideas much appreciated!
Simply change it to:
<html lang="en" ng-app>
Here's a working version of the JSFiddle: http://jsfiddle.net/EgPYA/