Topic: AngularJS

Convert object to array in Angularjs Example 0

Convert object to array in Angularjs Example

Today, We want to share with you Convert object to array in Angularjs Example.In this post we will show you convert object into array in Angular, hear for How to push JSON Object to array in AngularJs we will give you demo and example for implement.In this post, we will learn about Angular Converting an Object to an Array of Objects with an example.

Convert object to array in Angularjs Example

There are the Following The simple About Convert object to array in Angularjs Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop angularjs json object to array, so the some major convert object into array angular for this example is following below.

  • Angular Convert object to array

Angular Converting an Object to an Array of Objects

Convert object values into array the AngularJS

var allArr = [];
for (var x in formData){
   formData.hasOwnProperty(x) && allArr.push(formData[x])
}
console.log(allArr);

angular using ForEach array of objects

var liveArr = [];
angular.forEach(obj, function(value, key){
    liveArr.push(value);
});

JavaScript json object to array

Converting an Object to an Array of Objects using JavaScript

const memberObject = {
  jaydeep: {
    name: "jaydeep",
    age: 20
  },
  krunal: {
    name: "krunal",
    age: 22
  }
}
const memberArray = Object.values(memberObject)

Note: The following JavaScript example uses the memberObject from the above example.

const memberArray = Object.keys(memberObject).map(i => memberObject[i])

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
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 Convert object to array in Angularjs 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 Routing Tutorial with Examples 0

PHP Laravel 5.7 insert update delete in MySQL Example

Angular 6 Routing Tutorial with Examples

Today, We want to share with you Angular 6 Routing Tutorial with Examples.
In this post we will show you Angular 6 Route Configuration, hear for Handling Route Parameters in Angular 6 we will give you demo and example for implement.
In this post, we will learn about Angular 6 Routing & Navigation with an example.

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

First of all, let’s start or create our 2 menu icons work when We are clicked. In some order to do that, I should to visit simple Path the /src/app/app-routing.module.ts file.

Description: Angular 6 Routing & Navigation

In my previous posts I have explained various topics like Angular 6 Examples , Angular 6 Folder Project Structure , Angular 6 CLI Installation Tutorial With Example, Angular 6 Module File Tutorial with Examples, Angular 6 Components Tutorial with Examples, Angular 6 Expressions Tutorial with Examples ,Angular 6 Features Architecture Overview, Angular 6 Tutorial with Examples, Angularjs 6 User Registration and Login Authentication, Angular 6 and ASP.NET Core 2.0 Web API Example, Angular 6 CRUD Tutorial Example From Scratch ,Angular 6 applications – Insert, Fetch , Edit – update , Delete Operations,.

Angular 6 Routing Tutorial Example

/src/app/app-routing.module.ts

Add the following Angular 6 Routing: We can add config file or global angular 6 custom Routing to this add file, and also more import change other Routing custom files

/* Angular 6 Routing Example */
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

//global valuable
const routes: Routes = [];

//change angular 6
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

And then, second We should to import angular source code our more components at the simple top, and put them to the angular 6 Routes array displayed on line next above. /src/app/app-routing.module.ts for Angular 6 Routing

/* Angular 6 Routing Example */
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ClientComponent } from './users/users.component';
import { StudentComponent } from './student/student.component';
import { SubjectComponent } from './subjects/subjects.component';

//change angular 6
const routes: Routes = [
  {
    path: '',
    component: ClientComponent
  },
  {
    path: 'student/:id',
    component: StudentComponent
  },
  {
    path: 'subjects',
    component: SubjectComponent
  },
];

The first of all this 1 object particuler that the angular 6 ClientComponent will be the main root or default component run that all the templates loads on the root main path. I leave the simple display data path value empty for this components.

Read :

Summary

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

I hope you get an idea about Angular 6 Tutorial – Templates & Routing.
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.

Simple Multi Step Form with validation Using AngularJS 0

Simple Multi Step Form with validation Using AngularJS

Simple Multi Step Form with validation Using AngularJS

In this Post We Will Explain About is Simple Multi Step Form with validation 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 AngularJS Multi-Step Form Using UI Router Example

In this post we will show you Best way to implement AngularJS 1.5.x Multi-Step Form, hear for How to make multi step form in Angularjs with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

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 class="container">
    <div class="main row live">
      <div class="col-xl-12"> </div>
    </div>
    <div class="main row live">
      <div class="col-xs-12 col-sm-12 col-xl-12 col-lg-12">
        <h2>AngularJS 1.5.x Multi-Step Form</h1>
      </div>
    </div>
    <form name="StepByStepFrm" class="form-validation" role="form">
      <div class="animate-switch-container">
        <div class="animate-switch">
          <div class="main row live">
            <div class="col-xl-12">
              <p>Welcome to Pakainfo.com - the form.</p>
              <button type="button" class="btn btn-primary">Start</button>
            </div>
          </div>
        </div>
        <div class="animate-switch">
          <div class="main row live">
            <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
              <div class="form-group">
                <label for="tb-fname">First Name:</label>
                
                <span>
                  Max character length reached.
                </span>
              </div>
            </div>
          </div>
          <div class="main row live">
            <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
              <div class="form-group">
                <label for="tb-lname">Last Name:</label>
                
                <span>
                  Max character length reached.
                </span>
              </div>
            </div>
          </div>
          <div class="main row live">
            <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
              <div class="form-group">
                <label for="tb-email">Email:</label>
                
                <span>
                  Incorrect email format.
                </span>
                <span>
                 Please Max character length reached.
                </span>
              </div>
            </div>
          </div>
          <div class="main row live">
            <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
              <div class="form-group">
                <label for="tb-other-email">Other:</label>
                
                <span>
                  Incorrect Your email format.
                </span>
                <span>
                 Please Max character length reached.
                </span>
              </div>
            </div>
            <div class="col-xs-1 col-sm-1 col-xl-1 col-lg-1">
              <button type="button" class="btn btn-xs btn-warning">Add</button>
            </div>
          </div>
          <div class="main row live">
            <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
              <div>
              </div>
            </div>
          </div>
          <button type="button" class="btn btn-primary">Back</button>
          <button type="button" class="btn btn-primary">Next</button>
        </div>
        <div class="animate-switch">
          <div class="form-group">
            <label for="ta-body">Message Body:</label>
            <textarea class="form-control dt-lsiv" rows="5" id="ta-body"></textarea>
          </div>
          <button type="button" class="btn btn-primary">Back</button>
          <button type="button" class="btn btn-primary">Next</button>
        </div>
        <div class="animate-switch">
          <h3>Summary</h3>
          <p>First name: {{liveparam.userFname}}</p>
          <p>Last name: {{liveparam.userLname}}</p>
          <p>Email: {{liveparam.email}}</p>
          <p>Message Body: {{liveparam.messageBody}}</p>
          <button type="button" class="btn btn-primary">Back</button>
          <button type="button" class="btn btn-warning">Submit</button>
        </div>
        <div class="animate-switch">
          <div class="success-wrap">
            <h2 class="confirmation-text">Thank you</h2>
            <p>Your message has been sent.<br>You should receive a confirmation email.</p>
            <div><button type="button" class="btn btn-success">Send Another</button></div>
          </div>
        </div>
        <div class="animate-switch">
          <div class="error-wrap">
            <h2 class="confirmation-text">Error</h2>
            <p>There was an error when attempting to submit your request.<br>Please try again later.</p>
            <p><strong>*This will always error until a web service URL is set.*</strong></p>
            <div><button type="button" class="btn btn-danger">Try again</button></div>
          </div>
        </div>
      </div>
    </form>
    <div class="main row live">
      <div class="col-xs-12 col-sm-12 col-xl-12 col-lg-12"> </div>
    </div>
    <div class="main row live">
      <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
        <button type="button" class="btn btn-sm btn-primary">Toggle Object</button>
        <div> </div>
        <pre> {{ liveparam | json }}</pre>
      </div>
    </div>
    <div class="main row live">
      <div class="col-xs-12 col-sm-12 col-xl-12 col-lg-12"> </div>
    </div>
    <div class="main row live">
      <div class="col-xs-6 col-sm-6 col-xl-6 col-lg-6">
        <button type="button" class="btn btn-sm btn-primary">Toggle Form Errors</button>
        <div> </div>
        <ul>
          <li>Form Invalid</li>
          <li>Form Valid</li>
          <li> <strong>{{ key }}</strong> errors
            <ul>
              <li>{{ e.$name }} has an error: <strong>{{ key }}</strong>.</li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </div>

index.js

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

'use strict';

angular.module('liveApp', [
  'ngAnimate'
]).
controller('liveCtrl', ['$scope', '$http', function($scope, $http) {
  $scope.liveparam = {};
  $scope.phase = "";
  $scope.liveValidate = false;
  $scope.btnToggleJson = false;
  $scope.generateError = false;
  
  $scope.liveparam = {
    otherEmail: '',
    otherEmailList: []
  };
  
  // Navigation functions
  $scope.next = function (phase) {
    //$scope.mulridir = 1;
    //$scope.phase = phase;
    
    $scope.liveValidate = true;
    
    if ($scope.StepByStepFrm.$valid) {
      $scope.mulridir = 1;
      $scope.phase = phase;
      $scope.liveValidate = false;
    }
  };

  $scope.back = function (phase) {
    $scope.mulridir = 0;
    $scope.phase = phase;
  };
  
  // Other email list functions
  $scope.addOtherEmail = function () {
    $scope.userRId++;

    var email = {
      email: $scope.liveparam.otherEmail,
      userrow_id: $scope.userRId
    };

    $scope.liveparam.otherEmailList.push(email);

    $scope.liveparam.otherEmail = '';
  };

  $scope.removeCCEmail = function (userrow_id) {
    for (var i = 0; i < $scope.liveparam.otherEmailList.length; i++) {
      if ($scope.liveparam.otherEmailList[i].userrow_id === userrow_id) {
        $scope.liveparam.otherEmailList.splice(i, 1);
        break;
      }
    }
  };
  
  
  // Post to desired exposed web service.
  $scope.submitForm = function () {
    var myurl = "https://pakainfo.com/";

    // Check form validity and submit data using $http
    if ($scope.StepByStepFrm.$valid) {
      $scope.liveValidate = false;

      $http({
        method: 'POST',
        url: myurl,
        data: JSON.stringify($scope.liveparam)
      }).then(function successCallback(results) {
        if (results
          && results.data
          && results.data.status
          && results.data.status === 'success') {
          $scope.phase = "success";
        } else {
          if (results
            && results.data
            && results.data.status
            && results.data.status === 'error') {
            $scope.phase = "error";
          }
        }
      }, function errorCallback(results) {
        $scope.phase = "error";
        console.log(results);
      });
    }
  };
  
  $scope.reset = function() {
    // Clean up scope before destorying
    $scope.liveparam = {};
    $scope.phase = "";
  }
}]);

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

Angularjs multi step form validation

Multi-Step Form in Angular

I hope you have Got What is Multi Step Form with Progress Bar using Angularjs and CSS3 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 Introduction Tutorial features of angular 6.0 0

Angular 6 Introduction Tutorial features of angular 6.0

Angular 6 Introduction Tutorial features of angular 6.0

Today, We want to share with you Angular 6 Introduction Tutorial features of angular 6.0.
In this post we will show you Introduction to Angular 6, hear for Getting Started With Angular 6.0 we will give you demo and example for implement.
In this post, we will learn about Angular 6: Upgrading & Summary of New Features with an example.

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

What’s New in Angular 6.0

Latest version of Angular 6 is at this time available in market as well as angular 6 not a any drop-in value replacement for old version Like as Angular 5. If We have been data more developing with javascript frameworks Angular since Like as a version Angular 2, We very smartly remember that angular were not too hard stuck or difficult to angular upgrade to versio of the Angular 4 as well as last version Angular 5. In javascript most powerful projects, We can some change the Latest version in angular 6 numbers in your Like as apackage.json and We were on our way.

Why Upgrade in Angular 6.0?

In stands, the most valueable some change We push over minde in the last some means close or couple of some years was the details or introduction of javascript client side or server side HttpClient, which data changed ajax call http happened in old version Angular 4.3. as well as angular 6 wast not deleted in version of Angular 5; and then angular 6 was merely based default deprecated. That some data was also the one place to onther palces move from HTML DOM Based syntext of the template to changed angular 6 ng-template. It Was some call APIs removed in old version of the Angular 5, but We were not using this way in any of my any angular projects.

 to changed 

Upgrading to RxJS 6

In this version libs RxJS v6, more added of the class as well as some locations changed (libs namsapces or libs affecting your imports) as did the simple syntax We use to simple smarty way to manipulate data from an some client side to server side request HttpClient request.

With javascript RxJS version of the v5.x, your libs angular imports look as some belows:

//Getting Started With Angular 6.0
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';

With more angular 6 or RxJS v6.x, They have changed a some bit:

What's new in Angular 6.0
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

With angular v6.x, We have to include pipe sign the results into like as a map():

//Introduction of AngularJS 6.0
search(q: string): Observable {
   //pipe sign
  return this.getAll().pipe(
    map((data: any) => data
      .filter(product => JSON.stringify(product).toLowerCase().includes(q)))
  );
}

More Details of the Angular 6 Angular 6 Introduction Tutorial features of angular 6.0

Angular 6 Examples

There are the Angular 6 Step By Step Example and Learning AngularJS

Angular 6 Introduction Tutorial features of angular 6.0

Angular 6 Introduction Tutorial features of angular 6.0

We hope you get an idea about AngularJS 6.0 From Beginning
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch 0

ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch

Today, We want to share with you ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch.In this post we will show you AngularJS Inline CRUD with PHP, hear for Inline Table Add Edit Delete using AngularJS in PHP Mysql we will give you demo and example for implement.In this post, we will learn about AngularJS Inline CRUD Example Using PHP MySQLi Database with an example.

ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch

There are the Following The simple About ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop AngularJS Inline CRUD operation using PHP & MySQL, so the some major files and Directory structures for this example is following below.

  • index.php
  • select.php
  • insert.php
  • edit.php
  • delete.php

Step 1: Creating The Database connection

db_config.php

<?php
$connect = new PDO("mysql:host=localhost;dbname=member_list", "root", "atmiya2548");

?>

Step 2: AngularJS PHP Create, Read, Update, Delete

index.php

This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.php.

<html>  
    <head>  
        <title>ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch</title>  
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>  
    </head>  
    <body>  
        <div class="pakainfo container">  
   <br />
            <h3 align="center">ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch</h3><br />
   <div class="table-responsive pakainfo" ng-app="liveApp" ng-controller="liveController" ng-init="getMemData()">
                <div class="pakainfo alert alert-success alert-dismissible" ng-show="success" >
                    <a href="#" class="close" data-dismiss="alert" ng-click="closeMsg()" aria-label="close">×</a>
                    {{memMsgSuccess}}
                </div>
                <form name="testform" ng-submit="insertData()">
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>Member Name</th>
                                <th>Last Name</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><input type="text" ng-model="addData.member_fname" class="form-control" placeholder="Enter Member Name" ng-required="true" /></td>
                                <td><input type="text" ng-model="addData.member_lname" class="form-control" placeholder="Enter Last Name" ng-required="true" /></td>
                                <td><button type="submit" class="btn btn-success btn-sm" ng-disabled="testform.$invalid">Add</button></td>
                            </tr>
                            <tr ng-repeat="data in memberNames" ng-include="addDatatemplate(data)">
                            </tr>
                            
                        </tbody>
                    </table>
                </form>
                <script type="text/ng-template" id="display">
                    <td>{{data.member_fname}}</td>
                    <td>{{data.member_lname}}</td>
                    <td>
                        <button type="button" class="btn btn-primary btn-sm" ng-click="showEdit(data)">Edit</button>
                        <button type="button" class="btn btn-danger btn-sm" ng-click="deleteData(data.id)">Delete</button>
                    </td>
                </script>
                <script type="text/ng-template" id="edit">
                    <td><input type="text" ng-model="memberData.member_fname" class="memfield form-control"  /></td>
                    <td><input type="text" ng-model="memberData.member_lname" class="memfield form-control" /></td>
                    <td>
                        <input type="hidden" ng-model="memberData.data.id" />
                        <button type="button" class="btn btn-info btn-sm" ng-click="editData()">Save</button>
                        <button type="button" class="btn btn-default btn-sm" ng-click="reset()">Cancel</button>
                    </td>
                </script>         
   </div>  
  </div>
    </body>  
</html>  
<script>
var app = angular.module('liveApp', []);

app.controller('liveController', function($scope, $http){

    $scope.memberData = {};
    $scope.addData = {};
    $scope.success = false;

    $scope.addDatatemplate = function(data){
        if (data.id === $scope.memberData.id)
        {
            return 'edit';
        }
        else
        {
            return 'display';
        }
    };

    $scope.getMemData = function(){
        $http.get('select.php').success(function(data){
            $scope.memberNames = data;
        });
    };

    $scope.insertData = function(){
        $http({
            method:"POST",
            url:"insert.php",
            data:$scope.addData,
        }).success(function(data){
            $scope.success = true;
            $scope.memMsgSuccess = data.status;
            $scope.getMemData();
            $scope.addData = {};
        });
    };

    $scope.showEdit = function(data) {
        $scope.memberData = angular.copy(data);
    };

    $scope.editData = function(){
        $http({
            method:"POST",
            url:"edit.php",
            data:$scope.memberData,
        }).success(function(data){
            $scope.success = true;
            $scope.memMsgSuccess = data.status;
            $scope.getMemData();
            $scope.memberData = {};
        });
    };

    $scope.reset = function(){
        $scope.memberData = {};
    };

    $scope.closeMsg = function(){
        $scope.success = false;
    };

    $scope.deleteData = function(id){
        if(confirm("Are you sure you want to remove it?"))
        {
            $http({
                method:"POST",
                url:"delete.php",
                data:{'id':id}
            }).success(function(data){
                $scope.success = true;
                $scope.memMsgSuccess = data.status;
                $scope.getMemData();
            }); 
        }
    };

});

</script>

Step 3: ANGULARJS PHP MySQL Select Data

select.php

<?php  
//ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch
include('db_config.php');

$query = "SELECT * FROM member_table ORDER BY id DESC";
$statement = $connect->prepare($query);
if($statement->execute())
{
  while($row = $statement->fetch(PDO::FETCH_ASSOC))
  {
    $data[] = $row;
  }
  echo json_encode($data);
}

?>

Step 4: AngularJS Smart Table with Add Records

insert.php

<?php  
//ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch
include('db_config.php');

$status = '';

$mem_data_retrive = json_decode(file_get_contents("php://input"));

$data = array(
 ':member_fname'  => $mem_data_retrive->member_fname,
 ':member_lname'  => $mem_data_retrive->member_lname
);

$query = "
 INSERT INTO member_table 
 (member_fname, member_lname) VALUES 
 (:member_fname, :member_lname)
";

$statement = $connect->prepare($query);

if($statement->execute($data))
{
 $status = 'Data Inserted';
}

$output = array(
 'status' => $status
);

echo json_encode($output);

?>

Step 5: AngularJS Smart Table with Edit and Delete Records

edit.php

<?php  
//ANGULARJS PHP MySQL Inline CRUD Example Tutorial From Scratch
include('db_config.php');

$status = '';

$mem_data_retrive = json_decode(file_get_contents("php://input"));

$data = array(
 ':member_fname'  => $mem_data_retrive->member_fname,
 ':member_lname'  => $mem_data_retrive->member_lname,
 ':id'    => $mem_data_retrive->id
);

$query = "
 UPDATE member_table 
 SET member_fname = :member_fname, member_lname = :member_lname 
 WHERE id = :id
";

$statement = $connect->prepare($query);
if($statement->execute($data))
{
 $status = 'Data Edited';
}

$output = array(
 'status' => $status
);

echo json_encode($output);

?>

delete.php

<?php

include('db_config.php');

$status = '';

$mem_data_retrive = json_decode(file_get_contents("php://input"));

$query = "DELETE FROM member_table WHERE id = '".$mem_data_retrive->id."'";

$statement = $connect->prepare($query);
if($statement->execute())
{
 $status = 'Data Deleted';
}

$output = array(
 'status' => $status
);

echo json_encode($output);

?>

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 PHP MySQL Inline CRUD 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.

Angular Dynamic Creating Factory Components 0

Angular Dynamic Creating Factory Components

Angular Dynamic Creating Factory Components

In this Post We Will Explain About is Angular Dynamic Creating Factory Components 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 Dynamically Creating Factory Components With Angular Example

In this post we will show you Best way to implement Angular – Dynamic Component Factory, hear for Create Factory components at runtime with Angular with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

angularjs – Angular dynamic factory

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.

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>
    {{firstservices}}
    {{secondServices}}
</div>

index.js

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

var liveApp = angular.module("liveApp", []),
    makeService = function(module, param) {
        module.factory(param+'-service', function() {
            return function() {
                return param;
            };
        });
    };

makeService(liveApp, 'live1');
makeService(liveApp, 'live2');

liveApp.controller("liveCtrl", ['live1-service', 
                                '$injector',
                                '$scope',
                                function(service, $injector, $scope) {
    $scope.firstservices = service();   
    $scope.secondServices = $injector.get('live2-service')();
}]);

Angular Dynamic Factory Example

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 Dynamically Loading Factory and Views with 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.

AngularJS Datepicker Example Code With Demo 0

AngularJS Datepicker Example code with Demos

Today, We want to share with you AngularJS Datepicker Example code with Demo.In this post we will show you Angularjs Simple Datepicker Example using directive, hear for Simple Date Picker For jQuery and AngularJS we will give you demo and example for implement.In this post, we will learn about Simple Date Picker For jQuery and AngularJS with an example.

AngularJS Datepicker Example code with Demo

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

As I will cover this Post with live Working example to develop Simple Angularjs datepicker directive Example with Demo, so the some major files and Directory structures for this example is following below.

  • index.html

Angularjs Datepicker Example

index.html

This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code(angular datepicker no jquery as well as using jQuery) copy and write it into your any text editor Like Notepad++, then save file it as index.html.

<!DOCTYPE html>
<html>
<head>
	<title>Angularjs datepicker directive  - AngularJS Example code with Demo- Pakainfo.com</title>
	<!-- Include jquery-ui.min.css -->
	<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" /> 
	<!-- Latest jquery.min.js -->
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> 
	<!-- Include jquery-ui.min.js -->
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> 
	<!-- Include angular.min.js -->
	<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script> 
</head>
<body>
<div ng-app="date">
<div ng-controller="pakainfoController">
  <!-- jq -->
  <h1>Datepicker in angularjs example</h1>
  Using jquery date:<input type="text" id="livedatetime" name="livedatetime" ng-model="livedatetime">
  <span>{{livedatetime}}</span><br>
  <!-- ng -->
    using Angular Datepicker :<input type="text" datepicker ng-model="date2" />
  <span>{{date2}}</span>
</div>
<p>Related Examples : angularjs datepicker example, angularjs datepicker bootstrap, angularjs datepicker directive, datepicker in angularjs example jsfiddle, angular datepicker without jquery, angular datepicker no jquery</p>
</div>
<script type="text/javascript">
//AngularJS Datepicker Demo code with Example
	$(function () {
    		$("#livedatetime").datepicker({
	                    dateFormat: 'yy-mm-dd'
	                    });
	});
	angular.module("livedatetime", [])
	    .directive("datepicker", function () {
	    return {
	        restrict: "A",
	        link: function (scope, el, attr) {
	            el.datepicker({
	                            dateFormat: 'yy-mm-dd'
	                        });
	        }
	    };
	})
	    .controller("pakainfoController", function ($scope) {
	});
</script>
</body>
</html>

AngularJS Datepicker Example – Output

AngularJS Datepicker Example code with Demo

AngularJS Datepicker Example code with Demo

Angular Datepicker 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 AngularJS Datepicker Source code 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 Form Validation Example Tutorial From Scratch 0

Today, We want to share with you Angularjs Form Validation Example Tutorial From Scratch.In this post we will show you Angular Forms and Validation: Step By Step Example, hear for AngularJS Form Validation With ngMessages we will give you demo and example for implement.In this post, we will learn about AngularJS Form Validation: TextBox, Button Click with an example.

Angularjs Form Validation Example Tutorial From Scratch

There are the Following The simple About Angularjs Form Validation Example Tutorial From Scratch Full Information With Example and source code.

As I will cover this Post with live Working example to develop Angular Reactive Forms: trigger validation on submit, so the some major files and Directory structures for this example is following below.

  • index.php
  • app.js

angularjs form validation error message

Create index.php

This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.php.

<!DOCTYPE html>
<html lang="en" ng-app="membersApp">
<head>
    <meta charset="utf-8">
    <title>Angularjs Form Validation Example Tutorial From Scratch</title>
    <!-- Latest Version of the bootstrap.min.css -->
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!-- angular.min.js -->
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
    <style type="text/css">
      .liveErrorTxt{
        color:red;
      }
    </style>
</head>
<body ng-controller="membersController">
<div class="pakainfo container">
    <h1 class="page-header">Angularjs Form Validation Example Tutorial From Scratch</h1>
    <div class="pakainfo col-md-6 col-md-offset-3">
      <div class="pakainfo login-panel panel panel-success">
          <div class="panel-heading">
              <h3 class="panel-title"> Validation Form</h3>
          </div>
        <div class="panel-body">
            <form role="form" name="memberForm" novalidate>
              <fieldset>
                <div class="lst form-group">
                    <input type="text" class="memberfield form-control" name="memfirstname" placeholder="MemberName" ng-minlength="10" ng-maxlength="30" ng-pattern="/^[a-zA-Z0-9_]*$/" ng-model="member.memfirstname" required autofocus>
                    <div class="liveErrorTxt" ng-show="memberForm.memfirstname.$dirty && memberForm.memfirstname.$invalid">
                      <span ng-show="memberForm.memfirstname.$error.required">MemberName is required</span>
                      <span ng-show="memberForm.memfirstname.$error.minlength">MemberName must contain atleast 10 characters</span>
                      <span ng-show="memberForm.memfirstname.$error.maxlength">MemberName know not be greater than 30 characters</span>
                      <span ng-show="memberForm.memfirstname.$error.pattern && !memberForm.memfirstname.$error.minlength && !memberForm.memfirstname.$error.maxlength">Only letters, numbers and underscore allowed</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input type="password" class="memberfield form-control" name="password" placeholder="Password" ng-model="member.password" required>
                    <div class="liveErrorTxt" ng-show="memberForm.password.$dirty && memberForm.password.$invalid">
                      <span ng-show="memberForm.password.$error.required">Password is required</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input type="password" class="memberfield form-control" name="membersrespass" placeholder="Member Re-type Password" ng-model="member.membersrespass" required>
                    <div class="liveErrorTxt" ng-show="memberForm.membersrespass.$dirty && memberForm.membersrespass.$invalid || memberForm.membersrespass.$dirty && member.membersrespass != member.password">
                      <span ng-show="memberForm.membersrespass.$error.required">Re-type password is required</span>
                      <span ng-show="!memberForm.membersrespass.$error.required && member.membersrespass != member.password">Password did not match</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input  type="email" class="memberfield form-control" name="email" placeholder="Member Email" ng-model="member.email" required>
                    <div class="liveErrorTxt" ng-show="memberForm.email.$dirty && memberForm.email.$invalid">
                      <span ng-show="memberForm.email.$error.required">Member Email is required</span>
                      <span ng-show="memberForm.email.$error.email">Invalid email format</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input type="url" class="memberfield form-control" name="url" placeholder="Member Website" ng-model="member.website" required>
                    <div class="liveErrorTxt" ng-show="memberForm.url.$dirty && memberForm.url.$invalid">
                      <span ng-show="memberForm.url.$error.required">Member Website is required</span>
                      <span ng-show="memberForm.url.$error.url">Input a valid Member website</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input type="text" class="memberfield form-control" name="memberfirstname" placeholder="Member Firstname" ng-model="member.memberfirstname" required>
                    <div class="liveErrorTxt" ng-show="memberForm.memberfirstname.$dirty && memberForm.memberfirstname.$invalid">
                      <span ng-show="memberForm.memberfirstname.$error.required">Firstname is required</span>
                    </div>
                </div>
                <div class="lst form-group">
                    <input  type="text" class="memberfield form-control" name="memberlastname" placeholder="Member Lastname" ng-model="member.memberlastname" required>
                    <div class="liveErrorTxt" ng-show="memberForm.memberlastname.$dirty && memberForm.memberlastname.$invalid">
                      <span ng-show="memberForm.memberlastname.$error.required">Member Lastname is required</span>
                    </div>
                </div>
                <button type="button" class="btn btn-lg btn-success btn-block" ng-disabled="memberForm.$invalid || member.membersrespass != member.password" ng-click="submit()"><span class="live glyphicon glyphicon-check"></span> Validate</button>
              </fieldset>
            </form>
        </div>
      </div>
    <div class="alert alert-success" ng-show="valid">
      <button type="button" class="live close" ng-click="close()"><span aria-hidden="true">×</span></button>
      <span class="live glyphicon glyphicon-check"></span>Check Form Validated
    </div>
  </div>
</div>
<script src="app.js"></script>
</body>
</html>

AngularJS Script Source Code

Create app.js file

var membersApp = angular.module('membersApp', []);
membersApp.controller('membersController', function($scope){
	$scope.valid = false;
	$scope.submit = function(){
		$scope.valid = true;
	}
	$scope.close = function(){
		$scope.valid = false;
	}
});

Angularjs Form Validation Example Tutorial – Source code

Angularjs Form Validation Example Tutorial From Scratch - code

Angularjs Form Validation Example Tutorial From Scratch – code

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 Form Validation 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.

Angular 6 Reactive Forms Validation Tutorial Example 0

Angular 6 Reactive Forms Validation Tutorial Example From Scratch

Today, We want to share with you Angular 6 Reactive Forms Validation Tutorial Example From Scratch.In this post we will show you Angular 6 Forms Validation Example, hear for Angular 6 – Template-Driven Forms Validation Example we will give you demo and example for implement.In this post, we will learn about with an example.

Angular 6 Reactive Forms Validation Tutorial Example From Scratch

There are the Following The simple About Angular 6 Reactive Forms Validation Tutorial Example From Scratch Full Information With Example and source shortname.

As I will cover this Post with live Working example to develop Required, Email, URL, Dropdown and Min-Max min-length for Angular 6 Reactive Forms Validation, so the some major We are using a simple angular 6 registration HTML form with validation standard fields – for this simple example is following below.

  • Member
  • Email
  • Gender
  • Name
  • Password
  • Webwebsite URL

Step 1 : Make a project

new create angular 6 Project using CMD.

ng g new ng6memberFormValidation

Step 2 : Make member components

member.component.ts

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

@Component({
  selector: 'app-member',
  templateUrl: './member.component.html',
  styleUrls: ['./member.component.css']
})
export class MemberComponent implements OnInit {

  model: any = {};
  members : any;

  constructor() {
   }

  ngOnInit() {
    //Get member list.
    this.members =[
      {"id" :1, "name": "Jaydeep", "shortname":"jd"},
      {"id" :2, "name": "Krunal", "shortname":"kk"},
      {"id" :3, "name": "Ankit", "shortname": "aghu"},
      {"id" :4, "name": "vishal", "shortname": "vs"},
      {"id" :5, "name": "narendramodi", "shortname": "modi"},
      {"id" :6, "name": "sardarvalabhbhaipatel", "shortname": "patidar"},
      {"id" :7, "name": "chandni", "shortname": "chanu"},
      {"id" :8, "name": "sumitra", "shortname": "sumu"},
      {"id" :9, "name": "kajal", "shortname": "kaju"},
    ];

   //Default selected member Id.
   //this.model.member = 5;
  }

  public onSubmitMember() {
    alert('Your Member Details has been submitted successfully. :-)\n\n' + JSON.stringify(this.model))
  }
}

Step 3 : Include member.component.html

simple More And member.component.html

<h1>Register Member</h1>
<b>Angular 6 Reactive Forms Validation Tutorial Example From Scratch</b>
<hr>
<form name="form" (ngSubmit)="f.form.valid && onSubmitMember()" #f="ngForm" novalidate>
  <div class="container pakainfo">
    <label for="name"><b>Member Name</b></label>
    <input type="text" placeholder="Enter MEmber Name" name="name" [(ngModel)]="model.name" #name="ngModel" [ngClass]="{ 'is-invalid': f.submitted && name.invalid }" required>
    <div *ngIf="f.submitted && name.invalid" class="invalid-text">
      <div *ngIf="name.errors.required">Name is required</div>
    </div>

    <label for="email"><b>Email</b></label>
    <input type="text" placeholder="Enter Email" name="email" [(ngModel)]="model.email" #email="ngModel" [ngClass]="{ 'is-invalid': f.submitted && email.invalid }" required email>
    <div *ngIf="f.submitted && email.invalid" class="invalid-text">
      <div *ngIf="email.errors.required">Email is required</div>
      <div *ngIf="email.errors.email">Email must be a valid email address</div>
    </div>

    <label for="gender"><b>Gender</b></label>
    <select placeholder="Select Gender" name="gender" [(ngModel)]="model.gender" #gender="ngModel" [ngClass]="{ 'is-invalid': f.submitted && gender.invalid }" required>
      <option>Male</option>
      <option>Female</option>
      <option>Other</option>
    </select>
    <div *ngIf="f.submitted && gender.invalid" class="invalid-text">
      <div *ngIf="gender.errors.required">Member Gender is required</div>
    </div>
    <br>

    <label for="member"><b>Member</b></label>
    <select placeholder="Select member" name="member" [(ngModel)]="model.member" #member="ngModel" [ngClass]="{ 'is-invalid': f.submitted && member.invalid }" required>
      <option *ngFor="let member of members" [value]="member.id"> {{member.name}}</option>
    </select>
    <div *ngIf="f.submitted && member.invalid" class="invalid-text">
      <div *ngIf="member.errors.required">Member is required</div>
    </div>
    <br>

    <label for="website"><b>Member URL</b></label>
    <input type="url" placeholder="Enter website URL" name="website" pattern="https?://.+" [(ngModel)] ="model.website" #website="ngModel" [ngClass]="{ 'is-invalid': f.submitted && website.invalid }"  required url>
    <div *ngIf="f.submitted && website.invalid" class="invalid-text">
      <div *ngIf="website.errors.required">Member is required</div>
      <div *ngIf="website.errors.pattern">Must be a valid website URL</div>
    </div>

    <label for="psw-repeat"><b>Password</b></label>
    <input type="password" placeholder="Password" name="mempassword" [(ngModel)]="model.mempassword" #mempassword="ngModel" [ngClass]="{ 'is-invalid': f.submitted && mempassword.invalid }" required minlength="8">
    <div *ngIf="f.submitted && mempassword.invalid" class="invalid-text">
      <div *ngIf="mempassword.errors.required">Member Password is required</div>
      <div *ngIf="mempassword.errors.minlength">Member Password must be at least 8 characters</div>
    </div>

    <hr>
    <p>By Making an account you agree to our <a href="#">Terms & Privacy</a>.</p>
    <button type="submit" class="registerbtn">Register</button>

  </div>

  <div class="container signin">
    <p>Already has an account? <a href="#">Sign in</a>.</p>
  </div>
</form>

Step 4 : Angular 6 Routing, Module and FormsModule

Import the Angular 6 FormsModule, Angular 6 RouterModule, Angular 6 MemberComponent, routing for navigate add member page in the Angular 6 NgModule

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';

//Angular 6 Reactive Forms Validation Import
import { AppComponent } from './app.component';
import { MemberComponent } from './member/member.component';

@NgModule({
  declarations: [
    AppComponent,
    MemberComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    RouterModule.forRoot([{
      path:'member-link', component:MemberComponent }
    ])
  ],
  providers: [],
  bootstrap: [AppComponent]
})

export class AppModule { }

Angular 6 Reactive Forms Validation Tutorial Example – Output

Angular 6 Reactive Forms Validation Tutorial Example - output

Angular 6 Reactive Forms Validation Tutorial Example – output


Output looks like…….

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 Reactive Forms Validation 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.