Hey everyone, I need some help with my AngularJS code that should display an image when a checkbox is clicked.
This is the HTML code where checkboxes are generated:
<li ng-repeat="Dep in oDep" >
<input type="checkbox" ng-model="cboxDepState[Dep.num]"
ng-change="OnDepStateChange(Dep.num,Dep.nom)" />
</li>
Here is the second part of the HTML code for the loader image:
<div bg data-ng-show="loading['ville']" class="text-center ng-hide">
<img src="" />
</div>
And this is the AngularJS code:
var app = angular
.module("HomeModule", [])
.controller("HomeController", function (){
$scope.loading =[];
$scope.OnDepStateChange = function (numDep, nom) {
$scope.loading['ville'] = true;
//code inside function takes 5 seconds
//
$scope.loading['ville'] = false;
}});
Everything works fine except for the loading image. Can someone please help me fix it?