Why does the Button is not disable?
var mainApp = angular.module('mainApp', []);
mainApp.controller('mainController', function ($scope) {
$scope.form = {
login: ''
};
});
<form ng-controller="LoginAppCtrl as lc" ng-app="MTApp">
<div class="login">
<h1>LOG IN</h1>
</div>
<div>
<div>User Name :</div>
<div>
<input type="text" name="tbUserName" required ng-model="lc.request.user">
</div>
</div>
<div>
<div>Password :</div>
<div>
<input type="text" name="tbPassword" required ng-model="lc.request.password">
</div>
</div>
<div>
<div>
<button ng-click="lc.submitRequest()" ng-disabled="lc.request.user == '' || lc.request.password == '' ">Sign In</button>
</div>
</div>
</form>
I'm new in Angular JS and I am trying to make a simple login form, that if login success will be shown other form, and if not, login form will be stayed. Can anyone help me? I need the basic tutorials.
LoginAppCtrladd code of it..