sl_bug sl_bug - 1 year ago 67
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download