]
There is some kind of delay when I use ng-hide / ng-show, and that really bothers me. But when executed similarly in JS Fiddle, it works fine. Here is JS Fiddle
Any reason this is happening? And how can I fix this?
<div ng-controller="MyCtrl"> Hello, {{name}}! <button class="btn btn-warning" ng-show="isDisabled">HI</button> <button class="btn btn-primary" ng-hide="isDisabled">BYE</button> <a ng-click='relink()'> Link me to my existing account</a> </div>
Controller:
var myApp = angular.module('myApp', []); function MyCtrl($scope) { $scope.name = 'Superhero'; $scope.isDisabled = false; $scope.relink = function() { $scope.isDisabled = !$scope.isDisabled; } }
source share