
We are providing an example of Angular Login application. To develop this app, we have used HTML, CSS, Mysql, PHP and AngularJS.
In this example, we have a simple login page. Whenever user provides username and password, they will be authenticated and redirected to a home page on success. If authentication fails, the user is notified with an error message.
We have the main base page i.e. index.php where all other views are loaded. Following code explains the index page. Base script files which are required to run an application, are loaded when the application is bootstrapped.
Please look into the AngularLoginController code as shown below. Now, we need a javascript to hold all the configuration details required for an application to run. In this file, we configure the routes for an application which is done using UI Router.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<script> angular.module('AngularJSLogin', []) .controller('AngularLoginController', function($scope, $http){ this.loginForm = function(){ var user_data='user_email='+this.inputData.email+'&user_password='+this.inputData.password; $http({ method : "POST", |