I'm attempting to learn Angular JS. I have written this small piece of code, but for some reason I cannot get the HTML to recognize the Angular.JS.
My index.html file:
<!DOCTYPE HTML>
<html ng-app="store">
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css"/>
</head>
<body>
<div ng-controller = "storeController as store">
<h1>{{store.product.name}}</h1>
</div>
<script type = "text/javascript" src = "angular-1.2.29/angular.min.js"></script>
<script type = "text/javascript" src= "app.js"></script>
</body>
</html>
My app.JS file:
(function () {
var app = angular.module('store', [ ]);
app.controller('StoreController', function() {
this.product = item;
});
var item = {
name: 'stuff',
price: 2.44,
description: 'lame',
}
})();
My output is {{store.product.name}}, instead of the 'stuff' that i'm expecting.