angularify / angular-semantic-ui

[WiP] AngularJS native directives for Semantic UI
http://angularify.github.io/angular-semantic-ui
MIT License
383 stars 87 forks source link

Dimmer set model to false not working #39

Closed honomoa closed 9 years ago

honomoa commented 9 years ago

The dimmer is still display after set loading_dimmer to false;

controller:

.controller('DimmerCtrl', ['$scope', function($scope){
  $scope.call_dimmer = function(){
    console.log('show dimmer');
    $scope.loading_dimmer = true;
    setTimeout(function(){
      console.log('hide dimmer');
      $scope.loading_dimmer = false;
    }, 2000);
  }
}]);

html:

<page-dimmer class="ui page dimmer" ng-model="loading_dimmer" show="false"><div class="ui large text loader">Loading</div></page-dimmer>
<div ng-click="call_dimmer()"></div>
jspdown commented 9 years ago

@honomoa. Firstly, you shouldn't use setTimeout but $timeout instead. Secondly, there was a bug in our dimmer components. In fact, we forgot to reset dimmer classes when show is set to false

BTW, thanks for reporting and feel free to contribute