sl_bug sl_bug - 3 months ago 29
AngularJS Question

How to apply changes in angularjs (ng-show)?

I have form

<form ng-controller="SessionController" name="login_form">
<div class="hide" ng-show='invalid_credentials'>Invalid email/pass</div>
<input type="submit" value="Login" ng-click='login()'>


utApp.controller('SessionController', ($scope, $cookieStore, ClientService) ->
$scope.login = ->
if something
$scope.invalid_credentials = true

on some conditions
is getting set to true, but div with error message is not being shown. How to show it?


Angular doesn't re-check the value of your invalid_credentials variable. Using a function as your ng-show argument should work.