ng-click attribute not firing the function provided.
HTML:
<div class="row">
<div style="display:inline-block;width:20%;height:25%;margin:20px;" ng-repeat="news in dailyNews" >
<div class="thumbnail" ng-click="showNews({{news.id}})">
<img src="{{news.image}}" alt="images/noimg.jpg" style="width:100%">
<div class="caption" >
<h3 >{{news.heading}}</h3>
</div>
</div>
</div>
</div>
ROUTING SCRIPT:
.state('dashboard.user',{
url:'/user-dashboard',
templateUrl:'views/user.html',
controller:'userPanelCtrl'
})
CONTROLLER:
.controller('userPanelCtrl',function($state,$scope,userServices){
userServices.checkSession();
$scope.showNews = function(id){
localStorage.setItem("show-news",id);
}
})
I got the data successfully and loaded them to the html page using ng-repeat but the ng-click does not work on any of the div repeated. Thanks in advance.