Topic: AngularJS

Angular UI Grid Table Tutorial With Example 0

Angular UI Grid Table Tutorial With Example

Today, We want to share with you Angular UI Grid Table Tutorial With Example.In this post we will show you Angular UI Grid Table Example Steps, hear for Angular UI Grid with Laravel 5.6 CRUD Tutorial With Example we will give you demo and example for implement.In this post, we will learn about AngularJS Customised datatable Grids inline add edit delete with an example.

Angular UI Grid Table Tutorial With Example

There are the Following The simple About Angular UI Grid Table Tutorial With Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop AngularJS Double Click to inline editing Angular Grid Component, so the AngularJS Editable Grid component – GridView in Angular 6 for this example is following below.

Steps to use UI-Grid in AngualrJS

Include angularjs libs , ui-grid css and script files

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="http://ui-grid.info/release/ui-grid.js"></script>
<link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">

ui.grid module HTML Grid in angularjs Project

var memberApp = angular.module("memberApp", ["ui.grid"]);

css style to your AngularJS Grid application

<style type="text/css">
.liveUiGrid {
width: 600px;
height: 300px;
}
</style>

Define ui-grid directive in AngularJS

<div ng-controller="memberUiListController">
<div ui-grid="{ data: members }" class="liveUiGrid"></div>
</div>

AngularJS UI Grid Example

AngularJS UI Grid CRUD (Sorting Data, Filtering Data, Paging, Grouping)

Angular js Grid with CRUD operations

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>
         Angularjs UI-Grid Example
      </title>
      <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src="http://ui-grid.info/release/ui-grid.js"></script>
      <link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">
      <script type="text/javascript">
         var memberApp = angular.module("memberApp", ["ui.grid"]);
         memberApp.controller("memberUiListController", function ($scope) {
         $scope.members = [
         { name: "Jaydeep Gondaliya", age: 10, address: 'Rajkot' },
         { name: "Krunal Sisodiya", age: 30, address: 'Bombay' },
         { name: "Radhika Patel", age: 29, address: 'Bombay' },
         { name: "Kohali Virat", age: 25, address: 'Kalavad' },
         { name: "Yash Lunagariya", age: 27, address: 'Surat' }
         ];
         });
      </script>
      <style type="text/css">
         .liveUiGrid {
         width: 500px;
         height: 200px;
         }
      </style>
   </head>
   <body ng-app="memberApp">
      <h2>AngularJS UI Grid Example</h2>
      <div ng-controller="memberUiListController">
         <div ui-grid="{ data: members }" class="liveUiGrid"></div>
      </div>
   </body>
</html>

AngularJS UI Grid Sorting

AngularJS UI Grid Sorting Example

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>
         Angularjs Displayed Data in UI Grid Sorting Example
      </title>
      <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src="http://ui-grid.info/release/ui-grid.js"></script>
      <link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">
      <script type="text/javascript">
         var memberApp = angular.module("memberApp", ["ui.grid"]);
         memberApp.controller("memberUiListController", function ($scope) {
         $scope.gridOptions = {
         enableSorting: true,
         columnDefs: [
         { field: 'name' },
         { field: 'age' },
         { field: 'address', enableSorting: false }
         ],
         onRegisterApi: function (memberApi) {
         $scope.memberGridList = memberApi;
         }
         };
         $scope.members = [
         { name: "Jaydeep Gondaliya", age: 10, address: 'Rajkot' },
         { name: "Krunal Sisodiya", age: 30, address: 'Bombay' },
         { name: "Radhika Patel", age: 29, address: 'Bombay' },
         { name: "Kohali Virat", age: 25, address: 'Kalavad' },
         { name: "Yash Lunagariya", age: 27, address: 'Surat' }
         ];
         $scope.gridOptions.data = $scope.members;
         });
      </script>
      <style type="text/css">
         .liveUiGrid {
         width: 500px;
         height: 230px;
         }
      </style>
   </head>
   <body ng-app="memberApp">
      <h2>AngularJS - angular ui-grid grouping from object</h2>
      <div ng-controller="memberUiListController">
         <div ui-grid="gridOptions" class="liveUiGrid"></div>
      </div>
   </body>
</html>

AngularJS UI Advance Grid Filtering Example

AngularJS ng-grid table UI Grid Filtering

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>
         How to Implement or Add Filtering to AngularJS UI-Grid
      </title>
      <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src="http://ui-grid.info/release/ui-grid.js"></script>
      <link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">
      <script type="text/javascript">
         var memberApp = angular.module("memberApp", ["ui.grid"]);
         memberApp.controller("memberUiListController", function ($scope) {
         $scope.gridOptions = {
         enableFiltering: true,
         columnDefs: [
         { field: 'name' },
         { field: 'age' },
         { field: 'address', enableFiltering: false }
         ],
         onRegisterApi: function (memberApi) {
         $scope.memberGridList = memberApi;
         }
         };
         $scope.members = [
         { name: "Jaydeep Gondaliya", age: 10, address: 'Rajkot' },
         { name: "Krunal Sisodiya", age: 30, address: 'Bombay' },
         { name: "Radhika Patel", age: 29, address: 'Bombay' },
         { name: "Kohali Virat", age: 25, address: 'Kalavad' },
         { name: "Yash Lunagariya", age: 27, address: 'Surat' }
         ];
         $scope.gridOptions.data = $scope.members;
         });
      </script>
      <style type="text/css">
         .liveUiGrid {
         width: 500px;
         height: 230px;
         }
      </style>
   </head>
   <body ng-app="memberApp">
      <h2>Angular ui-grid table with ui-bootstrap pagination</h2>
      <div ng-controller="memberUiListController">
         <div ui-grid="gridOptions" class="liveUiGrid"></div>
      </div>
   </body>
</html>

AngularJS UI Grid Paging or Pagination Example

Simple Create AngularJS UI-Grid Editable – GridView

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>
         How to Create AngularJS UI-Grid Editable – GridView
      </title>
      <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
      <script src="http://ui-grid.info/release/ui-grid.js"></script>
      <link rel="stylesheet" href="http://ui-grid.info/release/ui-grid.css" type="text/css">
      <script type="text/javascript">
         var memberApp = angular.module("memberApp", ["ui.grid", "ui.grid.pagination"]);
         memberApp.controller("memberUiListController", function ($scope) {
         $scope.gridOptions = {
         paginationPageSizes: [25, 50, 75],
         paginationPageSize: 5,
         columnDefs: [
         { field: 'name' },
         { field: 'age' },
         { field: 'address' }
         ],
         onRegisterApi: function (memberApi) {
         $scope.memberGridList = memberApi;
         }
         };
         $scope.members = [
         { name: "Jaydeep Gondaliya", age: 10, address: 'Rajkot' },
         { name: "Krunal Sisodiya", age: 30, address: 'Bombay' },
         { name: "Radhika Patel", age: 29, address: 'Bombay' },
         { name: "Kohali Virat", age: 25, address: 'Kalavad' },
         { name: "Yash Lunagariya", age: 27, address: 'Surat' },
         { name: "Hardik Talpada", age: 38, address: 'Rajkot' },
         { name: "Rakesh Bhanderi", age: 25, address: 'Ganesh' },
         { name: "Sejal Parmar", age: 7, address: 'Rajkot' },
         { name: "Bhavana Pansuriya", age: 22, address: 'Vijayawada' },
         { name: "Amit Jivani", age: 23, address: 'California' },
         { name: "Parag Shukla", age: 34, address: 'Atlanta' },
         { name: "Narendra Modi", age: 29, address: 'Repalle' },
         { name: "Deepak Vaghela", age: 19, address: 'Guntur' },
         { name: "chirag dethariya", age: 27, address: 'Surat' }
         ];
         $scope.gridOptions.data = $scope.members;
         });
      </script>
      <style type="text/css">
         .liveUiGrid {
         width: 800px;
         height: 330px;
         }
      </style>
   </head>
   <body ng-app="memberApp">
      <h2>AngularJS UI Grid Paging Example</h2>
      <div ng-controller="memberUiListController">
         <div ui-grid="gridOptions" ui-grid-pagination class="liveUiGrid"></div>
      </div>
   </body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Angular UI Grid Table Tutorial With Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Angular 6 Autocomplete Search Tutorial With Example 0

Angular 6 Autocomplete Search Tutorial With Example from scratch

Today, We want to share with you Angular 6 Autocomplete Search Tutorial With Example from scratch.In this post we will show you Custom autocomplete directives in Angular 6, hear for AutoComplete Textbox in Angular 6 with Dynamic Data we will give you demo and example for implement.In this post, we will learn about Angular 6 autocomplete typeahead search example from scratch with an example.

Angular 6 Autocomplete Search Tutorial With Example from scratch

There are the Following The simple About Angular 6 Autocomplete Search Tutorial With Example from scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Angular 6 text input autocomplete, so the Using Angular 6 Material Auto-complete With Async Data for this example is following below.

Angular 6 Example

Angular Latest My Previous Post With Source code Read more…..

  1. Angular 6 Folder Project Structure
  2. Angular 6 CLI Installation
  3. Angular 6 Module File
  4. Angular 6 Components
  5. Angular 6 Services
  6. Angular 6 Routing
  7. Angular 6 CSS
  8. Angular 6 Class Binding
  9. Angular 6 Animation
  10. Angular 6 Templating
  11. Angular 6 HTTP Client

Step 1 : AngularJS autocomplete with callback ajax json

index.html

<link href="node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

<my-app>loading</my-app>

Step 2 : Angular 6 Material Auto-complete With Async Data

main.ts

import './polyfills';

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule).then(ref => {
  if (window['ngRef']) {
    window['ngRef'].destroy();
  }
  window['ngRef'] = ref;
}).catch(err => console.error(err));

Step 3 : Create a polyfills files

polyfills.ts

import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';

Step 4 : Main App Module and All files

app/app.component.css

* {
  font-family: Roboto;
}

.is-loading ::ng-deep .mat-option-text {
  display: flex;
  justify-content: center;
}

app/app.component.html

<h2>Angular 6 autocomplete from $http Example</h2>
<p>Create autocomplete search with Angular 6 Example</p>
<form class="example-form" [formGroup]='studentsForm'>
  <mat-form-field class="example-full-width">
    <input matInput placeholder="Choose a student" [matAutocomplete]="auto" formControlName='studentInput'>
  </mat-form-field>
  <span>Your choice is: {{studentsForm.get('studentInput').value | json}}</span>

  <mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">
    <mat-option *ngIf="isProcessing" class="is-loading"><mat-spinner diameter="50"></mat-spinner></mat-option>
    <ng-container *ngIf="!isProcessing">
      <mat-option *ngFor="let student of filteredStudents" [value]="student">
        <span>{{ student.name }}</span>
        <small> | ID: {{student.id}}</small>
      </mat-option>
    </ng-container>
  </mat-autocomplete>
</form>

app/app.component.ts

import { Component, OnInit } from '@angular/core';
import {Student, IUserResponse} from './student.class';
import {FormBuilder, FormGroup} from '@angular/forms';
import {AppService} from './app.service';
import {switchMap, debounceTime, tap, finalize} from 'rxjs/operators';
import {Observable} from 'rxjs'

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent implements OnInit {
  filteredStudents: Student[] = [];
  studentsForm: FormGroup;
  isProcessing = false;
  
  constructor(private fb: FormBuilder, private appService: AppService) {}

  ngOnInit() {
    this.studentsForm = this.fb.group({
      studentInput: null
    })

      this.studentsForm
      .get('studentInput')
      .valueChanges
      .pipe(
        debounceTime(300),
        tap(() => this.isProcessing = true),
        switchMap(value => this.appService.search({name: value}, 1)
        .pipe(
          finalize(() => this.isProcessing = false),
          )
        )
      )
      .subscribe(students => this.filteredStudents = students.results);
  }

  displayFn(student: Student) {
    if (student) { return student.name; }
  }
  
}

app/app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {HttpClientModule} from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import {MatFormFieldModule, MatInputModule, MatAutocompleteModule, MatButtonModule, MatProgressSpinnerModule} from '@angular/material';
import {HttpClientInMemoryWebApiModule} from 'angular-in-memory-web-api';
import {InMemDataService} from './in-memory-data.service';
import {AppService} from './app.service';

@NgModule({
  imports:      [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpClientModule,
    ReactiveFormsModule,
    MatInputModule,
    MatAutocompleteModule,
    MatFormFieldModule,
    MatButtonModule,
    MatProgressSpinnerModule,
    HttpClientInMemoryWebApiModule.forRoot(
      InMemDataService, { dataEncapsulation: false, delay: 1000 }),
    ],
  declarations: [ AppComponent, HelloComponent ],
  providers: [AppService],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

app/app.service.ts

import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {map, tap} from 'rxjs/operators';
import {Student, IUserResponse} from './student.class';

@Injectable()
export class AppService {

  constructor(private http: HttpClient) {}

  search(filter: {name: string} = {name: ''}, page = 1): Observable<IUserResponse> {
    return this.http.get<IUserResponse>('/api/students')
    .pipe(
      tap((response: IUserResponse) => {
        response.results = response.results
          .map(student => new Student(student.id, student.name))
          .filter(student => student.name.includes(filter.name))

        return response;
      })
      );
  }
}

app/hello.component.ts

import { Component, Input } from '@angular/core';

@Component({
  selector: 'hello Pakainfo',
  template: `<h1>Pakainfo.com Hello {{name}}!</h1>`,
  styles: [`h1 { font-family: Lato; }`]
})
export class HelloComponent  {
  @Input() name: string;
}

app/in-memory-data-service.ts

import { InMemoryDbService } from 'angular-in-memory-web-api';

export class InMemDataService implements InMemoryDbService {
  createDb() {
    let students = [
      { id: 1, name: 'Rachel Weisz' },
      { id: 2, name: 'Dianna Agron' },
      { id: 3, name: 'Scarlett Johansson ' },
      { id: 4, name: 'Jennifer Lawrence ' },
      { id: 5, name: 'Emma Stone' },
      { id: 6, name: 'Gal Gadot' },
      { id: 7, name: 'Alexandra Daddario' },
      { id: 8, name: 'Megan Fox' },
      { id: 9, name: 'Margot Robbie' },
      { id: 10, name: 'Jessica Alba' },
      { id: 11, name: 'Rachel McAdams' }
    ];
    return {students: {
      total: students.length,
      results: students
    }};
  }
}

student.class.ts

export class Student {
  constructor(public id: number, public name: string) {}
}

export interface IUserResponse {
  total: number;
  results: Student[];
}

Autocomplete with Search box in Angular 6 Demo

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Angular 6 Autocomplete Search Tutorial With Example from scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

AngularJS Search Filter Example with Demo 0

AngularJS Search Filter Example with Demo

Today, We want to share with you AngularJS Search Filter Example with Demo.In this post we will show you Simple search and filter with AngularJs, hear for AngularJs Live Search Filter Example with Demo we will give you demo and example for implement.In this post, we will learn about How to Implement a Search Filter on an HTML Table using AngularJS with an example.

AngularJS Search Filter Example with Demo

There are the Following The simple About AngularJS Search Filter Example with Demo Full Information With Example and source code.

As I will cover this Post with live Working example to develop AngularJS Filter Search Tutorial, so An angularjs filter array of objects in controller for this example is following below.

In AngularJS Search Filter, Custom filter is used fetch or recived filtered all the same as datatables subset of all the set items from any array items view list data based on member type term/search input filter key text.

Example 1 : AngularJS search filter

Example: Simple Search functionality in AngularJS
js/main.js

var pakaApp = angular.module("membeModule", []);
var membeController = function ($scope) 
     {
          var Member = [
          {
               MemberFname: "Sardar Vallabhbhai Patel",MemberLname: "Patel",Gender: "Male",company: "Pune",
          },
          {
               MemberFname: "Subhash Chandra Bose",MemberLname: "Bose",Gender: "Male",company: "Pune",
          },
          {
               MemberFname: "Indira Gandhi",MemberLname: "Gandhi",Gender: "Female",company: "US",
          },
          {
               MemberFname: "Dr. Rajendra Prasad",MemberLname: "Prasad",Gender: "Female",company: "Nagpur",
          },
          {
               MemberFname: "APJ Abdul Kalam",MemberLname: "Kalam",Gender: "Male",company: "Pune",
          }];
     $scope.Mem = Member;
     };
pakaApp.controller("liveCtrl", membeController);

index.html

<!DOCTYPE html>
<html ng-app="membeModule">
     <head>
          <script src="js/angular.min.js" type="text/javascript"></script>
          <script src="js/main.js"></script>
          <style>
               table, th, td
               {
                    border: 1px solid grey;
                    border-collapse: collapse;
                    padding: 6px;
               }
               table tr:nth-child(odd)
               {
                    background-color: #eeeeee;
               }
               table tr:nth-child(even)
               {
                    background-color: #3d3d3d;
               }
          </style>
     </head>
     <body style="font-family:Arial; font-size:medium; color:darkblue">
          <div ng-controller="liveCtrl">
               <h3>Search functionality in AngularJS.</h3>
               <br/>
               <h3> Search Member : <input type="text" ng-model= "searchMem"/></h3>
               <br/><br/>
               <table>
                    <tr>
                         <th>MemberFname</th>
                         <th>MemberLname</th>
                         <th>Gender</th>
                         <th>company</th>
                    </tr>
                    <tr ng-repeat="e in Mem | filter:searchMem">
                         <td>{{e.MemberFname}}</td>
                         <td>{{e.MemberLname}}</td>
                         <td>{{e.Gender}}</td>
                         <td>{{e.company}}</td>
                    </tr>
               </table>
          </div>
     </body>
</html>

Example 2 :AngularJS Filter Function or Search Filter

Syntax of using AngularJS Filter

{{YOUR_filterexpression | filter : expression}}

AngularJS Search Filter Example

index.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AngularJs filter Example - Pakainfo.com</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script>
	var app = angular.module("pakaApp", []);
	app.controller("memberController", function ($scope) {
	$scope.members = [{
		name: "Pt. Jawaharlal Nehru",
		age: 11
		}, {
		name: "B. R. Ambedkar",
		age: 29
		}, {
		name: "Atal Behari Vajpayee",
		age: 29
		}, {
		name: "Lal Bahadur Shastri",
		age: 24
		}];
	});
</script>
</head>
<body ng-app="pakaApp">
<div ng-controller="memberController">
	Enter Member Name to Filter:<input ng-model="searchmember" type="text" placeholder="Flter key">
	<table>
		<tr><th>Name</th><th>Age</th></tr>
		<tr ng-repeat="member in members | filter : searchmember">
		<td>{{member.name}}</td>
		<td>{{member.age}}</td>
		</tr>
	</table>
</div>
</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about AngularJS Search Filter Example with Demo.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

AngularJS HTTP AJAX Example Tutorial From Scratch 0

AngularJS HTTP AJAX Example Tutorial From Scratch

Today, We want to share with you AngularJS HTTP AJAX Example Tutorial From Scratch.In this post we will show you AngularJS – $http | AngularJS ajax, hear for Using The $http Service In AngularJS To Make AJAX Requests we will give you demo and example for implement.In this post, we will learn about Interacting With RESTful APIs Using $http in AngularJS with an example.

AngularJS HTTP AJAX Example Tutorial From Scratch

There are the Following The simple About AngularJS HTTP AJAX Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop AngularJS AJAX Call using $resource, $http, so the angularjs http get and Post parameters for this example is following below.

Syntax of Angularjs $http:

appName.controller('angularCTRLName',function($http) {
	$http({
		method: 'GET', //method name
		url: 'enter url here' //call api url
	}).then(function successCallback(response) {
		// data recieved
	}, function errorCallback(response) {
		//  error occured
	});
});

Shortcut methods for using angularjs $http:

angularjs http get example with parameters / angularjs http post example with parameters

$http.get('/myliveurl', config). then(function(response){-----------------}, function(){---------});
$http.post('/myliveurl', data, config). then(function(){-----------}, function(){------------});

Step 1 : HTML interface

index.html

<html>
<head>
	<title>AngularJS HTTP AJAX Example Tutorial From Scratch</title>
	<link rel="stylesheet" type="text/css" href="appname/css/style.css">
	<link rel="stylesheet" type="text/css" href="appname/css/bootstrap.min.css">
	<script type="text/javascript" src="appname/js/angular.min.js"></script>
	<script type="text/javascript" src="appname/js/app.js"></script>
</head>
<body>
<div ng-app="memberApp" ng-controller="memberController">
	<table class="col-md-offset-4 col-md-3 col-xs-12" border="1" >
		<thead><tr><td><strong>Member Id</strong></td><td>Name</td><td>Address</td></tr></thead>
		<tbody>
		<tr ng-repeat="n in memberlist"><td>{{n.nameid}}</td><td>{{n.name}}</td><td>{{n.member_address}} </td></tr>
		</tbody>
	</table>
</div>
</body>
</html>

Step 2 : Javascript File

app.js

var memberApp = angular.module("memberApp", []);
memberApp.controller('memberController', function ($scope, $http) {
	$http.get("member_details.txt")
	.then(function (response) {
		$scope.memberlist = response.data;
	}, function () {
		alert('error occured');
	});
})

Step 3 : CSS File

style.css

/* CSS include Fonts */
@import url(https://fonts.googleapis.com/css?family=Raleway);
table{
	width:500px;
	margin-bottom: 20px;
	border: 2px solid #3d3d3d;
}
thead td{
	background-color:#3df3d3;
	text-align:center;
	padding:20px;
}
tbody tr td {
	text-align:center;
	padding:20px;
}
tbody tr td:hover{
	background-color:#FEFFED;
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about AngularJS HTTP AJAX Example Tutorial From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

CRUD operation using AngularJS and WebAPI in ASP.NET WebForm 0

CRUD operation using AngularJS and WebAPI in ASP.NET WebForm

CRUD operation using AngularJS and WebAPI in ASP.NET WebForm

In this Post We Will Explain About is CRUD operation using AngularJS and WebAPI in ASP.NET WebForm 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 crud operation in angularjs with web api Example

In this post we will show you Best way to implement crud operations in mvc 5 using web api with angularjs, hear for CRUD operation using AngularJS and WebAPI in ASP.NET WebForm with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Make Team ASP.NET WebAPI

Define CustomerApp and Factory

var app = angular.module('teamApp', []);
        var url = 'api/teams/'; 
    app.factory('teamFactory', function ($http) {
            return {
                getTeam: function () {
                    return $http.get(url);
                },
                addTeam: function (team) {
                    return $http.post(url, team);
                },
                deleteTeam: function (team) {
                    return $http.delete(url + team.teamID);
                },
                updateTeam: function (team) {
                    return $http.put(url + team.Id, team);
                }
            };
        });

TeamController

app.controller('TeamController', function PostsController($scope, teamFactory) {
            $scope.indianTeams = [];
            $scope.progressing = true;
            $scope.addnwmode = false;
  
            $scope.toggleTeam = function () {
                this.team.editTeam = !this.team.editTeam;
            };
            $scope.toggleAddTeam = function () {
                $scope.addnwmode = !$scope.addnwmode;
            };
            $scope.save = function () {
                $scope.progressing = true;
                var tm = this.team;
                teamFactory.updateTeam(tm).success(function (data) {
                    alert("Team Saved Successfully!!");
                    tm.editTeam = false;
                    $scope.progressing = false;
                }).error(function (data) {
                    $scope.error = "An some Error has occured while Saving team! " + data.ExceptionMessage;
                    $scope.progressing = false;
  
                });
            };
  
            // add Team
            $scope.add = function () {
                $scope.progressing = true;
                teamFactory.addTeam(this.newteam).success(function (data) {
                    alert("Added Successfully!!");
                    $scope.addnwmode = false;
                    $scope.indianTeams.push(data);
                    $scope.progressing = false;
                }).error(function (data) {
                    $scope.error = "An Error has occured while Adding team! " + data.ExceptionMessage;
                    $scope.progressing = false;
  
                });
            };
            // delete Team
            $scope.delTeam = function () {
                $scope.progressing = true;
                var currentTeam = this.team;
                teamFactory.deleteTeam(currentTeam).success(function (data) {
                    alert("Deleted Successfully!!");
                    $.each($scope.indianTeams, function (i) {
                        if ($scope.indianTeams[i].teamID === currentTeam.teamID) {
                            $scope.indianTeams.splice(i, 1);
                            return false;
                        }
                    });
                    $scope.progressing = false;
                }).error(function (data) {
                    $scope.error = "An Error has occured while Saving team! " + data.ExceptionMessage;
                    $scope.progressing = false;
  
                });
            };
  
            //get all teams
            teamFactory.getTeam().success(function (data) {
                $scope.indianTeams = data;
                $scope.progressing = false;
            })
            .error(function (data) {
                $scope.error = "An Error has occured while progressing posts! " + data.ExceptionMessage;
                $scope.progressing = false;
            });
  
        });

Full Page Code:(index.html)



    <title>Team App | Pakainfo.com</title>
/1.0.6/angular.min.js
jquery/1.8.2/jquery.min.js
css/bootstrap.css

  
    <div class="container">
        <h2>teams</h2>
        <strong class="error">{{ error }}</strong>
        <div id="liveDiv">
            <img src="Images/482.gif" class="ajax-loader" />
        </div>
        <p><a href=";" class="btn btn-success">Add New</a></p>
        <form name="addTeam" style="width: 600px;margin: 0px auto">
            <label>Name:</label>
            <label>Email:</label>
            <br />          
            <span class="error">Invalid Email format!</span>
            <br />
            
            
            <br />
            <br />
        </form>
        <table class="table table-bordered table-hover" style="width: 900px">
            <tr>
                <th>#</th>
                <th>Team Name</th>
                <th>Team Email</th>
                <th></th>
            </tr>
            <tr>
                <td></td>
                <td>
                    </td>
                <td>
                    </td>
                <td></td>
            </tr>
  
            <tr>
                <td><strong>{{ team.teamID }}</strong></td>
                <td>
                    <p>{{ team.Name }}</p>
                    <p>
                        
                    </p>
                </td>
                <td>
                    <p>{{ team.Email }}</p>
                    </td>
                <td>
                    <p><a href=";">Edit</a> | <a href=";">Delete</a></p>
                    <p><a href=";">Save</a> | <a href=";">Cancel</a></p>
                </td>
            </tr>
        </table>
        <hr />
    </div>
   
     
        #liveDiv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; background-color: #c30000; opacity: .8; }
        .ajax-loader { position: absolute; left: 48%; top: 48%; margin-left: -25px; /* -1 * image width / 2 */ margin-top: -25px; /* -1 * image height / 2 */ display: block; }
          
    


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

Example

I hope you have Got What is ASP.NET Web API application with Angularjs Forms and Bootstrap 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.

Angular 6 AJAX Tutorial Example From Scratch 0

Angular 6 AJAX Tutorial Example From Scratch

Today, We want to share with you Angular 6 AJAX Tutorial Example From Scratch.In this post we will show you Angular 6 Http GET and POST Example, hear for angular 6 tutorial for beginners step by step we will give you demo and example for implement.In this post, we will learn about angular 6 tutorial for beginners with an example.

Angular 6 AJAX Tutorial Example From Scratch

There are the Following The simple About Angular 6 AJAX Tutorial Example From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Angular 6 HTTP Request Tutorial Example , so the Angular 6 CRUD Example Tutorial From Scratch for this example is following below.

Angular 6 Example

Angular Latest My Previous Post With Source code Read more…..

  1. Angular 6 Folder Project Structure
  2. Angular 6 CLI Installation
  3. Angular 6 Module File
  4. Angular 6 Components
  5. Angular 6 Services
  6. Angular 6 Routing
  7. Angular 6 CSS
  8. Angular 6 Class Binding
  9. Angular 6 Animation
  10. Angular 6 Templating
  11. Angular 6 HTTP Client

Step 1: Install Angular 6 Application.

I install An Angular via Angular CLI on Angular 6 Project.

//Angular CLI
npm install -g @angular/cli

//create a local project
ng new ng6getandpost

// start the application
ng serve --open

Step 2: Make a JSON simple server.


npm install -g json-server

src/data/db.json

{
    "products": [
    {
        "id": "1",
        "name": "PlayStation",
        "sellar": "Sony"
    },
    {
        "id": "2",
        "name": "Lipitor",
        "sellar": "Pfizer"
    },
    {
        "id": "3",
        "name": "Vehicle",
        "sellar": "Toyota (TM)"
    },
    {
        "id": "4",
        "name": "Movies",
        "sellar": "20th Century Fox"
    },
    {
        "id": "5",
        "name": "Tablet",
        "sellar": "Apple"
    }]
}

Start JSON server

json-server --watch src/data/db.json --port 4000

Step 3: Install and Inport HttpClient.

Angular 6 with HttpClient Module in app.module.ts files

import { HttpClientModule } from '@angular/common/http';

imports: [
    BrowserModule,
    HttpClientModule
  ],

Step 4: Create Angular 6 Product.ts model.

app/Product.ts

export interface Product {
    id: Number;
    name: String;
    sellar: String;
}

Step 5 : communicates to the server side

Create an angular 6 service that communicates(Browser) to the server.

ng g s product --spec false

app.module.ts

//hereimport this service angular 6 inside app.module.ts file. 
import { ProductService } from './product.service';

providers: [ProductService],

And then step is to simple the source code that Angular 6 HttpClient sends the GET methods to the send data and call a server and Retrive the data.

main file in product.service.ts

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class ProductService {

  url = 'http://localhost:4000';
  constructor(private http: HttpClient) { }

  getProducts() {
    return this
            .http
            .get(`${this.url}/products`);
        }
}

Step #6: HTML Interface showing Data

app.component.ts

import { Component , OnInit} from '@angular/core';
import { ProductService } from './product.service';
import { Product } from './Product';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';
  products: Product[];

  constructor(private productService: ProductService) { }

  ngOnInit() {
    this
      .productService
      .getProducts()
      .subscribe((data: Product[]) => {
        this.products = data;
    });
  }
}

Last step to, simple HTML interfae source code the main HTML file that show all the data.

<h3>Angular 6 Ajax HTTP POST Data with Parameters Example	</h3>
<table>
  <thead>
    <tr>
      <th>ID</th>
      <th>Product Name</th>
      <th>Sellar</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let product of products">
      <td>{{ product.id }}</td>
      <td>{{ product.name }}</td>
      <td>{{ product.sellar }}</td>
    </tr>
  </tbody>
</table>

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Angular 6 AJAX Tutorial Example From Scratch.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Remove Item from Array using AngularJS 0

Remove Item from Array using AngularJS

Remove Item from Array using AngularJS

In this Post We Will Explain About is Remove Item from Array using AngularJS 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 How to delete an item from a list in AngularJS Example

In this post we will show you Best way to implement Removing Elements from an Array in angularjs, hear for AngularJS: Adding and Removing Items in an Array with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

How to delete and add items on Angular.js

I had a real time bear of a some time figuring out how to remove an some item from a simple list in AngularJS.

Syntax of Remove and Add Item from Array in angular

app.controller('liveCtrl', function($scope) {
    // initial products
    $scope.products = [
    	'item Laptop',
    	'item Mobile',
    	'item PC'
    ];

    // add an item
    $scope.add = function() {
		//logic of add item
    	$scope.products.push($scope.input);
    };

    // Delete an item
    $scope.remove = function(index) {
		//logic of remove item
    	$scope.products.splice(index, 1);
    };
});

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.

   

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>
  <ul>
    <li>{{x}}
      <span>×</span>
    </li>
  </ul>
  
  <button>Add</button>
</div>

index.js

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

  var app = angular.module("myproductList", []); 

Full Example of Add and Remove Item in angularjs






  var app = angular.module("myproductList", []); 


<div>
  <ul>
    <li>{{x}}
      <span>×</span>
    </li>
  </ul>
  
  <button>Add</button>
</div>

<p>Click the Any remove item little x to remove an item from the Products list.</p>



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

Example

I hope you have Got What is Remove Item From Array With Angular Js 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.

AngularJS Fancybox Popup Simple Example 0

AngularJS Fancybox Popup Simple Example

Today, We want to share with you AngularJS Fancybox Popup Simple Example.In this post we will show you AngularJS Responsive Fancybox Popup Example, hear for Using FancyBox Angular JS for Fancybox lightbox pop-ups we will give you demo and example for implement.In this post, we will learn about Angular js – Using fancybox to open a pop up HTML page with an example.

AngularJS Fancybox Popup Simple Example

There are the Following The simple About AngularJS Fancybox Popup Simple Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop Angular js responsive fancyBox 2 demo and download, so the angular fancybox gallery with angular lightbox for this example is following below.

Step 1 : Create a HTML Interface

index.html

<!DOCTYPE html>
<html ng-app="FancyboxApp">

  <head>
    <meta charset="utf-8" />
    <title>AngularJS Responsive Fancybox Popup Example</title>
    
    <link  rel="stylesheet" href="fancybox/2.1.4/jquery.fancybox.css" />
    <link rel="stylesheet" href="fancybox/2.1.4/helpers/jquery.fancybox-thumbs.css" />
    <link rel="stylesheet" href="fancybox/2.1.4/helpers/jquery.fancybox-buttons.css" />

    <script src="jquery/1.8.2/jquery.js"></script>
    <script src="fancybox/2.1.4/jquery.fancybox.pack.js"></script>
    <script src="fancybox/2.1.4/jquery.fancybox.js"></script>
    <script src="fancybox/2.1.4/helpers/jquery.fancybox-thumbs.js"></script>
    <script src="fancybox/2.1.4/helpers/jquery.fancybox-media.js"></script>
    <script src="fancybox/2.1.4/helpers/jquery.fancybox-buttons.js"></script>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <link rel="stylesheet" href="style.css" />
    <script data-require="[email protected]" src="angularjs/1.0.8/angular.min.js" data-semver="1.0.8"></script>
    <script src="app.js"></script>
  </head>

  <body ng-controller="FancyboxController">
	<h3>AngularJS Responsive Fancybox Popup Example</h3>
    <ul>
      <li ng-repeat="member in members">
        <p>{{ member.name }} - {{ member.member_info }}</p>
        <a href ng-click="open_fancybox()">See more</a>
        <div class="wrapper" fancybox>
        <div class="future_fancybox_content">
          <p>This will be the content injected in fancybox.</p>
          <a href="#" ng-click="alert(member)">Now This links are main connected to the Info scope.</a>
        </div>
        </div>
        
      </li>
    </ul>
  </body>

</html>

Step 2 : Include AngularJS Scripts

app.js

var myapp = angular.module('FancyboxApp', []);

myapp.directive('fancybox', function($compile) {
  return {
    restrict: 'A',
    replace: false,
    link: function($scope, element, attrs) {

      $scope.open_fancybox = function() {
        
        var param = angular.element(element.html()),

        compiled = $compile(param);
        
        $.fancybox.open(param);

        compiled($scope);
     
      };
    }
  };
});

app.controller('FancyboxController', ['$scope',
  function ControllerZero($scope) {

    $scope.members = [{
      'name': 'Narendra Modi',
      'member_info': 'Full name: Narendra Damodardas Modi(Prime Minister of India).Born: 17 September 1950 (age 68 years), Vadnagar',
      'age': 1
    }, {
      'name': 'Virat Kohli',
      'member_info': 'Indian cricketer, Born: 5 November 1988 (age 29 years), Delhi,Height: 1.75 m',
      'age': 2
    }, {
      'name': 'Amitabh Bachchan',
      'member_info': 'Indian film actor, Born: 11 October 1942 (age 75 years), Allahabad, Height: 1.85 m',
      'age': 3
    }];
    
    $scope.alert = function (member) { window.alert(member.name); };

  }
]);

Step 3 : Custom Style CSS

style.css

.wrapper { display: none; }

Using FancyBox Angular JS for Fancybox lightbox pop-ups
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about AngularJS Fancybox Popup Simple Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Angular 6 Chart Example using Charts Package 0

Angular 6 Chart Example using Charts Package

Today, We want to share with you Angular 6 Chart Example using Charts Package.In this post we will show you Beautiful Angular 6 Charts & Graphs, hear for Simple Demo and Example of PIE Chart in Angular 6 we will give you demo and example for implement.In this post, we will learn about Angular 6 Chart Application Tutorial From Scratch with an example.

Angular 6 Chart Example using Charts Package

There are the Following The simple About Angular 6 Chart Example using Charts Package Full Information With Example and source code.

As I will cover this Post with live Working example to develop Angular 6 Chart Component – Charting and Graphs, so the some major files and Directory structures for this example is following below.

  • Angular 6 Charts.
  • Install Angular 6.
  • Install ng2-charts angular 6 library.
  • MAke a server
  • Insert Angular 6 HttpClientModule
  • Add the ChartsModule.
  • Angular 6 display chart.

Angular 6 Example

Angular Latest My Previous Post With Source code Read more…..

  1. Angular 6 Folder Project Structure
  2. Angular 6 CLI Installation
  3. Angular 6 Module File
  4. Angular 6 Components
  5. Angular 6 Services
  6. Angular 6 Routing
  7. Angular 6 CSS
  8. Angular 6 Class Binding
  9. Angular 6 Animation
  10. Angular 6 Templating
  11. Angular 6 HTTP Client

Step #1: Install Step By step Angular 6.

using installed Angular CLI

npm install -g @angular/cli

Make a local new project

ng new charts

Step #3: Install Simple ng2-charts.

//install simple ng2-charts
npm install rxjs-compat --save


//install npm main library.
npm install ng2-charts --save

Step #4: Make a server

Make a server that main PHP serves backend get All the data.

yarn global add json-server

db.json

{
    "devlopers": [
    {
        "name": "Dipati",
        "year": "2019",
        "point": "18117"
    },
    {
        "name": "Rahul",
        "year": "2019",
        "point": "100"
    },
    {
        "name": "Rahul",
        "year": "2014",
        "point": "200"
    },
    {
        "name": "Rahul",
        "year": "2016",
        "point": "300"
    },
    {
        "name": "Rahul",
        "year": "2018",
        "point": "100"
    },
    {
        "name": "Priyanka",
        "year": "2019",
        "point": "200"
    },
    {
        "name": "Shital",
        "year": "2019",
        "point": "14460"
    },
    {
        "name": "Bhakti",
        "year": "2019",
        "point": "8006"
    },
    {
        "name": "Bhavika",
        "year": "2019",
        "point": "4879"
    },
    {
        "name": "Rupal",
        "year": "2019",
        "point": "4217"
    },
    {
        "name": "Jaya",
        "year": "2019",
        "point": "1866"
    },
    {
        "name": "Chandni",
        "year": "2019",
        "point": "1848"
    },
    {
        "name": "Krupali",
        "year": "2019",
        "point": "1674"
    },
    {
        "name": "Snehal",
        "year": "2019",
        "point": "1284"
    },
    {
        "name": "Jigar shah",
        "year": "2019",
        "point": "1272"
    },
    {
        "name": "Pratik",
        "year": "2019",
        "point": "967"
    },
    {
        "name": "Nilesh",
        "year": "2019",
        "point": "793"
    },
    {
        "name": "Jignesh",
        "year": "2019",
        "point": "723"
    },
        {
        "name": "Ravi",
        "year": "2019",
        "point": "644"
        },
        {
        "name": "Hitesh",
        "year": "2019",
        "point": "622"
        },
    {
        "name": "Mayur",
        "year": "2019",
        "point": "495"
    },
    {
        "name": "Vijay",
        "year": "2019",
        "point": "430"
    },
    {
        "name": "Vishal",
        "year": "2019",
        "point": "344"
    },
    {
        "name": "Krunal",
        "year": "2019",
        "point": "324"
    },
    {
        "name": "Geeta",
        "year": "2019",
        "point": "542"
    },
    {
        "name": "Ankit",
        "year": "2019",
        "point": "520"
    },
    {
        "name": "Jaydeep",
        "year": "2019",
        "point": "542"
    }]
}

Start JSON Server

json-server --watch db.json --port 4000

Step #5: Add Angular 6 HttpClientModule

app.module.ts

// app.module.ts

import { HttpClientModule } from '@angular/common/http';

imports: [
    ...
    HttpClientModule
],

app.component.ts

// app.component.ts

import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';
  constructor(private httpClient: HttpClient) {}
}

Step #6: Import Angular 6 ChartsModule.

app.module.ts

// app.module.ts

import { ChartsModule } from 'ng2-charts';

imports: [
    ...,
    ChartsModule
  ],

Step #7: display chart.

app >> Data.ts

// Data.ts

export interface Data {
    name: String;
    year: Number;
    point: Number;
}

app.component.ts

import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Data } from './Data';

//Angular 6 Chart Example using Charts Package
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

export class AppComponent implements OnInit {

  title = 'app';
  data: Data[];
  url = 'http://localhost:4000/devlopers';
  year = [];
  point = [];

  public lineChartData: Array = [
    {data: this.point, label: 'Rahul Devlopers'},
  ];
  public lineChartLabels: Array = this.year;
  public lineChartOptions: any = {
    responsive: true
  };
  public lineChartColors: Array = [
    {
      backgroundColor: 'rgba(192,151,232,0.2)',
      borderColor: 'rgba(192,151,232,1)',
      pointBackgroundColor: 'blue',
      pointBorderColor: 'blue',
      pointHoverBackgroundColor: '#3d3d3d',
      pointHoverBorderColor: 'rgba(192,151,232,0.8)'
    }
  ];
  public lineChartLegend: Boolean = true;
  public lineChartType: String = 'line';
 //simple Angular 6 Chart Example using Charts Package
  constructor(private httpClient: HttpClient) {}

  ngOnInit() {
    this.httpClient.get(this.url).subscribe((res: Data[]) => {
      this.data = res.filter(r => {
        return r.name === 'Rahul';
      });
      this.data.forEach(y => {
        this.year.push(y.year);
        this.point.push(y.point);
      });
    });
  }
}

Angular 6 Chart – Output

Angular-6-Charts-Example-Tutorial
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Angular 6 Chart Example using Charts Package.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

AngularJS Form Validation 0

AngularJS Form Validation

AngularJS Form Validation

In this Post We Will Explain About is AngularJS Form Validation 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 angularjs form validation on submitExample

In this post we will show you Best way to implement AngularJS Form Validation With ngMessages, hear for Easy Form Validation in AngularJS with ngMessageswith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

AngularJS provides simple client-side HTMLform validation. It checks the some state of the HTML form and DOM input fields ( Like as a input, textarea box, select box), and lets We notify the all the user about the current state means errors.

It also holds the some information about whether the HTML input fields have been some touched, or all the data modified, or not.

There are the Following directives are used to track some errors in an AngularJS HTML form:

1> $dirty – angular states that some value has been changed.
2> $invalid – angular states that some value entered is invalid.
3> $error – angular states the some exact error.

Code : AngularJS Form Validation Example

index.html

  
   
     
      <title>Step By step Angular JS Forms</title>  
        
        
   
	//Devloped By Pakainfo.com
         table, th , td {  
            border: 1px solid grey;  
            border-collapse: collapse;  
            padding: 5px;  
         }  
     //Devloped By Pakainfo.com      
         table tr:nth-child(odd) {  
            background-color: lightpink;  
         }  
      //Devloped By Pakainfo.com     
         table tr:nth-child(even) {  
            background-color: lightyellow;  
         }  
        
        
     
     
        
      <h2>Live AngularJS Sample Application</h2>  
      <div>  
           
         <form name="empForm">  
            <table border="0">  
               <tr>  
                  <td>Enter first name:</td>  
                  <td>  
                     <span style="color:red">  
                        <span>Your First Name is required.</span>  
                     </span>  
                  </td>  
               </tr>  
                 
               <tr>  
                  <td>Enter last name: </td>  
                  <td>  
                     <span style="color:red">  
                        <span>Your Last Name is required.</span>  
                     </span>  
                  </td>  
               </tr>  
                 
               <tr>  
                  <td>Email: </td><td>  
                     <span style="color:red">  
                        <span>Your Email is required.</span>  
                        <span>Your Invalid email address.</span>  
                     </span>  
                  </td>  
               </tr>  
                <tr>  
                  <td>  
                     <button>Reset</button>  
                  </td>  
                  <td>  
                     <button>Submit</button>  
                  </td>  
               </tr>  
     </table>  
         </form>  
      </div>  
          
         var liveApp = angular.module("liveApp", []);  
         liveApp.controller('EmpCtrl', function($scope) {  
            $scope.dataReset = function(){  
               $scope.fname = "DSP";  
               $scope.lname = "Patel";  
               $scope.email = "[email protected]";  
            }  
             $scope.dataReset();  
         });  
        
       
  

Example

I hope you have Got What is AngularJS Form Validation And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.