Top 10 Best Angular Examples with Demo

Top 10 Best Angular Examples with Demo

Today, We want to share with you Top 10 Best Angular Examples with Demo.
In this post we will show you Basic Example in array of angular, hear for Best Angular Examples we will give you demo and example for implement.
In this post, we will learn about 10 Best Tutorials To Learn AngularJS with an example.

AngularJS arrays are like sane as JavaScript arrays.
here more than 3 example avilable in this post.

 <div ng-app="" ng-init="numbers=[192,110,158,1574,245]">
<p>The Simple numbers list of Fourth result is =<b> <span ng-bind="numbers[3]"></span></b></p>
</div> 

Example 1: AngularJs Array Push Values

<html lang="en">
<head>
<title>Simple Example of AngularJs Array Push Values</title>
 <script src="yourappfolder/js/angular.min.js"></script>
 <script>
var infinityknowApp = angular.module("infinityknowApp", []);
 infinityknowApp.controller("ng4Ctrl", function($scope) {
 $scope.categoryArray = ['Men','Woman','electric','computer','shope'];
 $scope.pushaddInArraydata = function() {
	 // Total get the input data value
	 var newinputdataVal = $scope.newarrayinvalue;
	 $scope.categoryArray.push(newinputdataVal);
	 
 };
});
</script>
</head>
<body>  
<div ng-app="infinityknowApp">  
	<div ng-controller="ng4Ctrl"> 
	 
	 Enter a value and click "Push" Button to insert in array.
	 <input type="text" name="arrayexample" ng-model="newarrayinvalue"><br>
	 <button ng-click='pushaddInArraydata()' >Push</button>
	 <hr/>
	 Array = {{categoryArray}}<br>
	 <hr/>
	 	 <a href="https://infinityknow.com/" alt="link to free download in angularjs example" >AngularJS Master Example | demo | Download</a>

	</div> 
</div>
</body>  
</html>  

Example 2 : item push in array using AngularJS

<html ng-app>
<head>
<title>AngularJS Array push value - Pakainfo.com</title>
<script type="text/javascript" 
	src="yourappfoldername/angular.min.js"></script>
</head>
<body>
<div ng-controller="emailaddressCtrl">
	 Email:<input type="text" ng-model="newcontact"/>
	<button ng-click="dataaddlist()">Email Add</button>
	<h2>List of Email Address</h2>
	<hr/>
	<ul>
		<li ng-repeat="email in emailaddress"> {{$index + 1}} = {{ email }} </li>
	</ul>
	 <hr/>
	 <a href="https://infinityknow.com/" alt="link to free download in angularjs example" >AngularJS Master Example | demo | Download</a>

</div>
<script type="text/javascript">
	function emailaddressCtrl($scope) {
	    $scope.emailaddress = ["[email protected]", "[email protected]"];

	    $scope.dataaddlist = function() {
		$scope.emailaddress.push($scope.newcontact);
		$scope.newcontact = "";
	    }
	}
</script>
</body>
</html>

How to “push’ a new item value to the middle of an array list?

var countrylist = ["india","pakistan","austreliya", "germany","china"]

function dataAdd (newitem, setpostvalue){
    var datalengthval = countrylist.length;
    for(i = datalengthval -1; i >= setpostvalue; i--){
        countrylist[datalengthval] = countrylist[i];
        datalengthval--;
    };
    countrylist[setpostvalue] = newitem;
};

dataAdd("japan",2) //data value to add it to the middle position


Create an array using ng-init angular js

    <html ng-app>
    <head>
	<title>create an Array with AngularJS's ng-init function used</title>
    <script src="yourappfolder/angular.js"></script>
    </head>
    <body>
        <div ng-init="names=[{name:'angularking',city:'India'},   {name:'hardeepsinh jadeja',city:'japan'},{name:'Narendra Modi',city:'Delhi'}]">
            <ul>
                  <h3><font face="Impact" color="green" size = "6"><li data-ng-repeat="dataitemlist in names">{{dataitemlist.name}} - {{dataitemlist.city}}</li></font></h3>
            </ul>
        </div>
			 <a href="https://infinityknow.com/" alt="link to free download in angularjs example" >AngularJS Master Example | demo | Download</a>

    </body>
    </html>
	

We hope you get an idea about Top 10 Best Angular Examples with Demo
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.

READ :  AngularJS Toaster Notifications - AngularJS - Message toast system

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

Add a Comment

Your email address will not be published. Required fields are marked *