I have app.js file that contains the following code:
(function () {
var app = angular.module('store', []);
app.controller('StoreController', function () {
this.product = gem;
});
var gem = {
name: 'Dodechaedron',
price: 2.95,
description: '...',
};
})();
I also have the following html file that contains the following code:
<div ng-app="StoreController as store">
<h1>{{store.product.name}}</h1>
<h2>{{store.product.price}}</h2>
<p>{{store.product.description}}</p>
</div>
<script src="Scripts/angular.min.js"></script>
<script src="app.js"></script>
it also includes
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="store">
When I build the app - nothing happens. The question is - where is mi data from the app.js file?
Thank you.
StoreController as store?$scopevariables to store data and keep static data like above in its own factory/service.