Below is aap.js
from my AngularJS app.
var app = angular.module('gallery',[]);
(function(){
app.controller('GalleryController',function(){
this.tab = true;
});
})();
and gallery.html
is:
<html ng-app="gallery">
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript" src="app.js"></script>
<link rel="shortcut icon" href="">
</head>
<body ng-contoller="GalleryController as g">
<section >
<ul>
<li><img ng-click="tab=1" src="images/gem-01.jpg" height="100" /></li>
</ul>
<h1>{{g.tab}}</h1>
</section>
</body>
</html>
g.tab
, which is a property of controller, is not being shown in view. Why is that so?