How to migrate my AngularJS code to Angular? Below is the code for the login form.I Want to upgrade this to Angular. Please Help me out. TIA
var app = angular.module('myApp', []);
app.controller('mainCtrl', function($scope, $location) {
$scope.submit = function() {
if ($scope.username && $scope.password) {
var user = $scope.username;
var pass = $scope.password;
if (pass == "admin" && user == "manoj@admin.com") {
alert("Login Successful");
jQuery(location).attr('href', '')
} else if (user != "manoj@admin.com") {
alert("Invalid username");
} else if (pass != "admin" && user == "manoj@admin.com") {
alert("Invalid password");
}
}
}
});
Below is my HTML code
<div class="login-form">
<div class="login-face" ><div class="text-center"><img src="assets/images/login_face.png" ></div></div>
<section class="form">
<form>
<div class="input">
<input type="text" id="username" placeholder="Username" ng-model="username">
<i class="fa fa-user"></i>
</div>
<div class="input">
<input type="password" id="password" placeholder="Password" ng-model="password">
<i class="fa fa-lock"></i>
</div>
<div class= "text-center" style="margin-top:50px">
<input type="submit" id="login" ng-click="submit()" value="Log in"/>
</div>
</form>
</section>
</div>