Thursday, March 30, 2017

angularjs - Angular js Div show only for 3 seconds - Stack Overflow

angularjs - Angular js Div show only for 3 seconds - Stack Overflow



Inject the $timeout service in the controller and use it to unset loginAlertMessage.
  app.controller('MyController', function ($scope, $timeout) {
    $scope.loginAlertMessage = true;

    $scope.forgotPassword = function () {
         $scope.loginAlertMessage=false; 
         $timeout(function () { $scope.loginAlertMessage = true; }, 3000);   
    };

    // ...
  }

No comments: