Skip to content
  • Home
  • Blog
    • yttags
    • Youtube
  • Categories
  • Tools
  • Server-Side
    • php
    • Node.js
    • ASP.NET
    • Magento
    • Codeigniter
    • Laravel
    • Yii
  • JS
    • AngularJS
    • Ajax
    • VueJs
    • jQuery
    • ReactJS
    • JavaScript
  • Full Form
  • Guest Post
  • Advertise
  • About
  • Contact Us
Pakainfo

Pakainfo

Web Development & Good Online education

AngularJS Simple Login Form

June 13, 2018 Pakainfo Technology, AngularJS Leave a comment
Rate this post

AngularJS Simple Login Form

In this Post We Will Explain About is AngularJS Simple Login Form With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Creating a simple login with AngularJS Example

Free Live Chat for Any Issue

In this post we will show you Best way to implement AngularJS Login Application, hear for AngularJS User Registration and Login Example with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Simple Login Form In AngularJS

In this Example,First of all Add or Include External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priority set.After that Include your relevant CSS Class.

Read Also:  Time-Range-Picker jquery time range picker example - jQueryUI TimeRangePicker

External Include file

AngularJS is a simple JavaScript framework Include one type of the (library) based on a very user friedly popular software mvc based architecture menas called the MVC.

//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js
//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js
//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.18/angular-ui-router.js

index.html

The Angular simple directives and the User’s view HTML DOM in a web-application page form the HTML view. In our example(Pakainfo.com), the simple HTML view comprises the HTML All the element, and then simple two angular directives Like as a namely angular ng-app as well as agular ng-controller

<div class="container" ng-app="liveApp">
  <div class="row">
    <div class="col-xl-12">
      <div class="page-header">
        <h1>Welcome- {{ title }}</h1>
      </div>
    </div>
    
    <div ui-view></div>
    
  </div>
  
  <script type="text/ng-template" id="signin.html">
    <div class="col-xl-12">
      <h3>SIGNIN Page</h3>
      
      <form ng-submit="liveFormSubmit()" class="form">
        <div class="col-xl-4">
          <div class="live form-group">
            <input type="text" class="live form-control" ng-model="clientname" placeholder="clientname" required=""/>
          </div> 

          <div class="live form-group">
            <input type="password" class="live form-control" ng-model="password" placeholder="password" required=""/>
          </div>

          <div class="live form-group">
            <button type="submit" class="btn btn-success">Login</button>
            <span class="text-danger">{{ error }}</span>
          </div>

        </div>
      </form>
    </div>
  </script>
  
  <script type="text/ng-template" id="dashboard.html">
    <div class="col-xl-12">
      <h3>Welcome Page</h3>
		Dashboard
      <a ui-sref="signin">Back</a>
    </div>
  </script>
</div>

index.js

The simple angular controller works as a all the data of the mediator between HTML views and models.

Read Also:  Laravel 6 Eloquent Join Multiple Tables

(function() {
  var liveApp = angular.module('liveApp', ['ui.router']);
  
  liveApp.run(function($rootScope, $location, $state, LoginService) {
    $rootScope.$on('$stateChangeStart', 
      function(event, toState, toParams, fromState, fromParams){ 
          console.log('Changed state to: ' + toState);
      });
    
      if(!LoginService.checkIsAuth()) {
        $state.transitionTo('signin');
      }
  });
  
  liveApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise('/dashboard');
    
    $stateProvider
      .state('signin', {
        url : '/signin',
        templateUrl : 'signin.html',
        controller : 'signCtrl'
      })
      .state('dashboard', {
        url : '/dashboard',
        templateUrl : 'dashboard.html',
        controller : 'dashboardCtrl'
      });
  }]);

  liveApp.controller('signCtrl', function($scope, $rootScope, $stateParams, $state, LoginService) {
    $rootScope.title = "Pakainfo.com AngularJS SIGNIN Example";
    
    $scope.liveFormSubmit = function() {
      if(LoginService.signin($scope.clientname, $scope.password)) {
        $scope.error = '';
        $scope.clientname = '';
        $scope.password = '';
        $state.transitionTo('dashboard');
      } else {
        $scope.error = "Incorrect clientname/password !";
      }   
    };
    
  });
  
  liveApp.controller('dashboardCtrl', function($scope, $rootScope, $stateParams, $state, LoginService) {
    $rootScope.title = "Pakainfo.com - AngularJS Login Sample";
    
  });
  
  liveApp.factory('LoginService', function() {
    var adminclientname = 'live24u';
    var pass = 'pass';
    var checkIsAuth = false;
    
    return {
      signin : function(clientname, password) {
        checkIsAuth = clientname === adminclientname && password === pass;
        return checkIsAuth;
      },
      checkIsAuth : function() {
        return checkIsAuth;
      }
    };
    
  });
  
})();

AngularJS Login Application

Read Also:  NodeJS RESTful API User Authentication with AngularJS using PHP MYSQL

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

Download

I hope you have Got What is Simple login example with Ionic and AngularJS And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

Related posts:

  1. Simple Multi Step Form with validation Using AngularJS
  2. How To Create Image Hover Overlay Effects?
  3. Multiple image slider in html source code
  4. AngularJS Form Validation
  5. Reset Password Form Free bootstrap Widget Template
  6. vue js Simple Login Form Tutorials
  7. how to make a login page in html with database?
  8. AngularJS Login Script using PHP MySQL
  9. simple testimonial slider bootstrap using html javascript
  10. Angularjs Login And Registration Modal Template
angular 2 login form exampleangular 4 login pageangularjs login authentication exampleangularjs login demoangularjs login example jsfiddleangularjs user registration form examplelogin page using angularjs and bootstraplogin page using angularjs in mvc

Post navigation

Previous Post:Vuejs Login And SignUp Modal Template
Next Post:Get HTML source code of page with php – Scrape

Search

Write For Us

We’re accepting well-written informative guest posts and this is a great opportunity to collaborate.
Submit a guest post to [email protected]
Contact Us

Freelance web developer

Do you want to build a modern, lightweight, responsive website quickly?
Need a Website Or Web Application Contact : [email protected]
Note: Paid Service
Contact Me
Cricday

Categories

3movierulz (48) Ajax (464) AngularJS (377) ASP.NET (61) Bollywood (92) Codeigniter (174) CSS (96) Earn Money (61) Education (53) Entertainment (108) fullform (77) Google Adsense (62) Highcharts (77) Hollywood (93) JavaScript (1354) Jobs (39) jQuery (1421) Laravel (1083) LifeStyle (50) movierulz4 (47) Mysql (1029) Mysqli (890) Node.js (38) php (2110) Programming (2320) Python (96) ReactJS (37) Software (101) Software (77) Stories (78) tamilrockers (88) Tamilrockers kannada (48) Tamilrockers telugu (47) Tech (101) Technology (2359) Tips and Tricks (107) Tools (110) Top10 (291) Trading (49) Trending (45) VueJs (250) Web Technology (83) webtools (128) wordpress (165) World (118)

Advertise With Us

Increase visibility and sales with advertising. Let us promote you online.
Click Here

A To Z Full Forms

Access a complete full forms list with the meaning, definition, and example of the acronym or abbreviation.
Click Here

Web Development & Good Online education : Pakainfo by Pakainfo.
Top
Subscribe On YouTube : Download Source Code & New itsolutionstuck
We accept paid guest Posting on our Site : Guest Post Chat with Us On WhatsApp