Wednesday, 7 September 2016

AngularJs- Easy pie cart - Circle shape

AngularJs- Easy pie cart - Circle shape :
------------------------------------------

easychart.html
--------------
<!doctype html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8"/>
<title>Angular</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>



<div class="angular" ng-controller="chartCtrl">
<span class="chart" easypiechart ng-init="options1" percent="percent1" options="options1">
<span class="percent" ng-bind="percent1"></span>
</span>
<input type="range" min="-100" max="100" step="1" ng-model="percent" />

<span class="chart" easypiechart ng-init="options2 = { animate:false, barColor:'#00FF00', scaleColor:false, lineWidth:3, lineCap:'butt' }" percent="percent2" options="options2">
<span class="percent" ng-bind="percent2"></span>
</span>
<input type="range" min="-100" max="100" step="1" ng-model="percent2" />

<span class="chart" easypiechart percent="anotherPercent" options="anotherOptions">
<span class="percent" ng-bind="percent"></span>
</span>
<input type="range" min="-100" max="100" step="1" ng-model="anotherPercent" />
</div>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.js"></script>
<script src="angular.easypiechart.min.js"></script>
<script>
var app = angular.module('app', ['easypiechart']);
app.controller('chartCtrl', ['$scope', function ($scope) {
$scope.percent1 = 65;

$scope.options1 = {
lineCap:'butt',
            barColor:'#00FF00',
            scaleColor:'#dfe0e0',
            lineWidth:3,
            lineCap:'circle',
//trackColor:'red'
        };
$scope.percent2 = 45;
$scope.anotherPercent = -45;
$scope.anotherOptions = {
animate:{
duration:0,
enabled:false
},
barColor:'#2C3E50',
scaleColor:false,
lineWidth:20,
lineCap:'circle'
};
}]);
</script>
</body>
</html>

style.css-
---------


ul {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  height: 60px;
  background: #cccccc;
  font-size: 0;
  line-height: 0;
  letter-spacing: -0.3em;
}
li {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 25%;
  text-align: center;
  font-size: 18px;
  line-height: 60px;
  letter-spacing: normal;
}
li a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
li a:hover,
li a.active {
  background: #333333;
  color: #ffffff;
}
li a.active:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -10px;
  border: 10px solid;
  border-color: transparent;
  border-top-color: #333333;
}
.chart {
  position: relative;
  display: inline-block;
  width: 110px;
  height: 110px;
  margin-top: 50px;
  margin-bottom: 50px;
  text-align: center;
}
.chart canvas {
  position: absolute;
  top: 0;
  left: 0;
}
.percent {
  display: inline-block;
  line-height: 110px;
  z-index: 2;
}
.percent:after {
  content: '%';
  margin-left: 0.1em;
  font-size: .8em;
}
.angular {
  margin-top: 100px;
}
.angular .chart {
  margin-top: 0;
}
input {
  display: block;
  margin: auto;
  margin-bottom: 3em;
}
.btn {
  display: block;
  width: 200px;
  margin: 0 auto;
  padding: 10px 20px;
  background: #cccccc;
  color: #ffffff;
  text-transform: uppercase;
  cursor: pointer;
  font-size: 0.8em;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.btn:hover {
  background: #333333;
  color: #ffffff;
}
.span6 {
  float: left;
  width: 50%;
}
@media only screen and (max-width: 600px) {
  li {
    font-size: 14.4px;
  }
}
@media only screen and (max-width: 430px) {
  .span6 {
    float: none;
    width: 100%;
  }
  body {
    padding-top: 0;
  }
  ul {
    height: auto;
    position: static;
  }
  li {
    display: block;
    width: 100%;
  }
  li a {
    white-space: normal;
  }
  a.active:after {
    display: none;
  }
}
Courtosy:--->


anguarl.easypiechart.min.js-
---------------------------
/**!
 * easy-pie-chart
 * Lightweight plugin to render simple, animated and retina optimized pie charts
 *
 * @license
 * @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
 * @version 2.1.7
 **/
!function(a,b){"function"==typeof define&&define.amd?define(["angular"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("angular")):b(angular)}(this,function(a){!function(a){"use strict";return a.module("easypiechart",[]).directive("easypiechart",[function(){return{restrict:"AE",require:"?ngModel",scope:{percent:"=",options:"="},link:function(b,d,e){b.percent=b.percent||0;var f={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,size:110,rotate:0,animate:{duration:1e3,enabled:!0}};b.options=a.extend(f,b.options);var g=new c(d[0],f);b.$watch("percent",function(a,b){g.update(a)})}}}])}(a);var b=function(a,b){var c,d=document.createElement("canvas");a.appendChild(d),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(d);var e=d.getContext("2d");d.width=d.height=b.size;var f=1;window.devicePixelRatio>1&&(f=window.devicePixelRatio,d.style.width=d.style.height=[b.size,"px"].join(""),d.width=d.height=b.size*f,e.scale(f,f)),e.translate(b.size/2,b.size/2),e.rotate((-0.5+b.rotate/180)*Math.PI);var g=(b.size-b.lineWidth)/2;b.scaleColor&&b.scaleLength&&(g-=b.scaleLength+2),Date.now=Date.now||function(){return+new Date};var h=function(a,b,c){c=Math.min(Math.max(-1,c||0),1);var d=0>=c?!0:!1;e.beginPath(),e.arc(0,0,g,0,2*Math.PI*c,d),e.strokeStyle=a,e.lineWidth=b,e.stroke()},i=function(){var a,c;e.lineWidth=1,e.fillStyle=b.scaleColor,e.save();for(var d=24;d>0;--d)d%6===0?(c=b.scaleLength,a=0):(c=.6*b.scaleLength,a=b.scaleLength-c),e.fillRect(-b.size/2+a,0,c,1),e.rotate(Math.PI/12);e.restore()},j=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),k=function(){b.scaleColor&&i(),b.trackColor&&h(b.trackColor,b.trackWidth||b.lineWidth,1)};this.getCanvas=function(){return d},this.getCtx=function(){return e},this.clear=function(){e.clearRect(b.size/-2,b.size/-2,b.size,b.size)},this.draw=function(a){b.scaleColor||b.trackColor?e.getImageData&&e.putImageData?c?e.putImageData(c,0,0):(k(),c=e.getImageData(0,0,b.size*f,b.size*f)):(this.clear(),k()):this.clear(),e.lineCap=b.lineCap;var d;d="function"==typeof b.barColor?b.barColor(a):b.barColor,h(d,b.lineWidth,a/100)}.bind(this),this.animate=function(a,c){var d=Date.now();b.onStart(a,c);var e=function(){var f=Math.min(Date.now()-d,b.animate.duration),g=b.easing(this,f,a,c-a,b.animate.duration);this.draw(g),b.onStep(a,c,g),f>=b.animate.duration?b.onStop(a,c):j(e)}.bind(this);j(e)}.bind(this)},c=function(a,c){var d={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(a,b,c,d,e){return b/=e/2,1>b?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},onStart:function(a,b){},onStep:function(a,b,c){},onStop:function(a,b){}};if("undefined"!=typeof b)d.renderer=b;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");d.renderer=SVGRenderer}var e={},f=0,g=function(){this.el=a,this.options=e;for(var b in d)d.hasOwnProperty(b)&&(e[b]=c&&"undefined"!=typeof c[b]?c[b]:d[b],"function"==typeof e[b]&&(e[b]=e[b].bind(this)));"string"==typeof e.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[e.easing])?e.easing=jQuery.easing[e.easing]:e.easing=d.easing,"number"==typeof e.animate&&(e.animate={duration:e.animate,enabled:!0}),"boolean"!=typeof e.animate||e.animate||(e.animate={duration:1e3,enabled:e.animate}),this.renderer=new e.renderer(a,e),this.renderer.draw(f),a.dataset&&a.dataset.percent?this.update(parseFloat(a.dataset.percent)):a.getAttribute&&a.getAttribute("data-percent")&&this.update(parseFloat(a.getAttribute("data-percent")))}.bind(this);this.update=function(a){return a=parseFloat(a),e.animate.enabled?this.renderer.animate(f,a):this.renderer.draw(a),f=a,this}.bind(this),this.disableAnimation=function(){return e.animate.enabled=!1,this},this.enableAnimation=function(){return e.animate.enabled=!0,this},g()}});

HTML5 - Model popup desing in simple design

HTML5 - Model popup desing in simple design:
---------------------------------------------------

<!doctype html>
<html>
<head>
<style>
body{
   font-family: arial;
   font-size: 14px;
   background:#ccc;
}

.heading{
font-weight: bold;
font-size: 18px;
background: #0067c4;
color:#fff;
line-height: 50px;
padding-left:2%;
text-align: center;
}
.heading-text{
padding:1% 2%;
color:#333333;
}

.modal {
    /* some styles to position the modal at the center of the page */
    position: relative;   
   margin-left: auto; margin-right: auto;
    width: 70%;       
    background-color: #fff;
    /* needed styles for the overlay */
    z-index: 10; /* keep on top of other elements on the page */
    /*outline: 9999px solid rgba(0,0,0,0.5);*/

}
.version-div,.date-div{
font-weight: 
color:#0067C5;
text-align: left;
padding-left: 4%;
}
.version-div
{width: 20%;}
.date-div{
width: 70%;
}
th,b{
color:#0067C5;
}
ul
{
    list-style-type: none;
}
table{
color:#333333;

}
table, th, td {
   border: 1px solid #ccc;
}

</style>
</head>
<body>
<div class="modal">
<div class="heading"> HEADING </div>
<div class="heading-text">Sub Heading for the model popup</div>


 <table style="width:100%" border="1">
  
  <tr>
<th class="version-div" >Version Number</th>
<th class="date-div">Date of Release</th> 
  </tr>
  <tr>    
     <td colspan="2">
  <ul>
 <li><b>Feature1Name</b>
 <p>content - Sub Heading for the model popup</p></li>
  <li><b>Feature2Name</b>
 <p>content - Sub Heading for the model popup</p></li>
  </ul>
     </td> 
  </tr>

  <tr>
<th class="version-div" >Version Number</th>
<th class="date-div">Date of Release</th> 
  </tr>
  <tr>    
     <td colspan="2">
  <ul>

 <li><b>Feature1Name</b>
 <p>content for Sub Heading for the model popup</p></li>
  <li><b>Feature2Name</b>
 <p>content   for the model popup</p></li>
 
  </ul>
     </td> 
  </tr>
  </table>
</div>
</body>
</html>

Angular JS - Share or call function from custome Directive to Contoller

Angular JS - Share or call function from custome Directive to Contoller
----------------------------------------------------------------------

<!DOCTYPE html>
<html >
<head>
<meta name="description" content="Simplest Controllers sharing Service" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
  <meta charset="utf-8">
  
  <script>
  var myApp = angular.module('MyCtrl', []);
myApp.directive('passObject', function() {
  return {
    restrict: 'E',
    scope: {
      obj: '='
    },
    template: '<div>Hello, {{obj.prop}}!<input type="text" ng-model="stext"   ng-change="changeValue(stext)" /><button ng-click="changeValue(stext)">Change Value</button></div></div>',
    link: function(scope, element, attrs) {
      scope.changeValue = function(stext) {
        scope.obj.prop = stext;//"Change form directive";
      }
    }
  };
});

myApp.controller('MyCtrll', function($scope) {
  $scope.obj = {
    prop: "world"
  };
});
  </script>
  <body>
  
<div ng-app="MyCtrl">
  <div ng-controller="MyCtrll">
    <pass-object obj="obj"></pass-object>
    <div>
      Controller {{obj.prop}}
    </div>
  </div>
</div>
  
  </body>
  </html>



Alternate Soln: 1
-----------------

use $parent.changevalue(stext) for some different kind of array value changes.

Alternate Soln: 2
-------------------  
  http://jsfiddle.net/L8masomq/

<div ng-app="dr" ng-controller="testCtrl">
    <test color1="color1" data-method="ctrlFn"></test>    
</div>


Script:
-------

var app = angular.module('dr', []);

app.controller("testCtrl", function($scope) {
    $scope.ctrlFn = function(arg) {        
        alert(arg);
    }
    
});
app.directive('test', function() {
    return {
        restrict: 'E',
        scope: {
            fromDirectiveFn: '=method'
        },
        link: function(scope, elm, attrs) {
            //Way One
            scope.hello = "some message";
            scope.fromDirectiveFn(scope.hello);
        }
    }
});
AngularJS- Search form simple example and JSON object to Array Itration
=========================================================
Controller:
===========

    $scope.SearchChange = function(input){
        $scope.searchResult = searchAPI(input);
    }

    $scope.searchclick = function(input, isLength){
        $scope.searchResult = searchAPI(input, isLength);
    }

    function searchAPI(input, isLength){
        var output = {Customers: [], Sites : [], Groups : []};
        if(input.length >= 3 || isLength){
            $http.get('app/json/search.json').success(function(response) {
                    //Filter Customers
                    output.Customers = response.customers.rows.filter(function(x) {
                            return x.name.toLocaleLowerCase().includes(input.toLocaleLowerCase()) ? true : false
                    }).map(function(x){
                        return x.name
                    })

                    //Filter Sites
                    output.Sites = response.sites.rows.filter(function(x) {
                            return x.name.toLocaleLowerCase().includes(input.toLocaleLowerCase()) ? true : false
                    }).map(function(x){
                        return x.name
                    })
                    
                    //Filter Groups
                    output.Groups = response.groups.rows.filter(function(x) {
                            return x.name.toLocaleLowerCase().includes(input.toLocaleLowerCase()) ? true : false
                    }).map(function(x){
                        return x.name
                    })

                });
        }
        return output;
    }

Ng-view:
========


 <form  role="search" id="customerform" >
                    <div class="input-group">
                        <input type="text" ng-disabled="disabled" class="form-control" placeholder="Search"  ng-model ="searchText" ng-change="SearchChange(searchText)" >
                        <span class="input-group-btn">  
                            
                            <button type="submit" class="btn btn-default" type="button" ng-click="searchclick(searchText, true)">
                                <i class="fa fa-search ng-scope" ng-if="!searching" slide-toggle="#searchresult"></i>
                            </button>
                        </span>
                         <div class="tool-tip-head hide ng-isolate-scope" tool-tip="" tool-tip-content="Please enter a valid search data">
                            <div class="tooltip bottom-right in tooltip-inner"><span class="tooltip-arrow"></span>
                            Please enter a valid search data</div>
                        </div>
                    </div>
                </form>



 <ul class="list-group">
                    <li class="list-group-item" ng-repeat="customername in searchResult.Customers track by $index">
                        {{customername}}
                    </li> 
                </ul>
                <ul class="list-group">
                    <li class="list-group-item" ng-repeat="sitename in searchResult.Sites track by $index">
                        {{sitename}}
                    </li> 
                </ul>
                <ul class="list-group">
                    <li class="list-group-item" ng-repeat="groupname in searchResult.Groups track by $index">
                        {{groupname}}
                    </li> 
                </ul>


search.json:
============


{
"success": true,
"totalCount": 88,
"customers": {
"count": 11,
"rows": [{
"id": "1033453434536",
"name": " Infdgdfdia Pvt Ltd ."
}, {
"id": "13453453403",
"name": " Ltd."
}, {
"id": "1034534533",
"name": "Jagdfpan Corp."
}, {
"id": "10345345317",
"name": "! Inc. Asia"
}, {
"id": "4987998798144",
"name": " Idfgndia Pvt Ltd."
}, {
"id": "10190571",
"name": " Switzerland Server Services SARL"
}, {
"id": "145098989882674",
"name": "Yahoo! rPte Ltd."
}, {
"id": "0980980981034139",
"name": "Yahoo! Inc."
}, {
"id": "0980980981427949",
"name": "Yahodwo! Corp."
}, {
"id": "098098091033022",
"name": "Yaewrerhoo!7"
}, {
"id": "0980910260d65",
"name": "Yahdfoo! Research Ltd."
}]
},
"sites": {
"count": 75,
"rows": [{
"id": "0980981083960",
"name": Oogfgdfaki"
}, {
"id": "098092168076",
"name": "Ogadfgdfdfgki"
}, {
"id": "0980982168601",
"name": Cordfgdfporation"
}, {
"id": "1501bvfdg857",
"name": "Yahodfgdfgdffdgo-Kitakyushu"
}, {
"id": "22101ddfgf48",
"name": Corpdfgdfgoration"
}, {
"id": "180dfg5685",
"name": "Yahoo - 19 Rue FR"
}, {
"id": "980981058568",
"name": "Yahoo!Shaftesbur y Avenue"
}, {
"id": "0981044051",
"name": "yacxvhoo-londxcvon"
}, {
"id": "092129136",
"name": "YAHOO! - C/O TEcvLECITY"
}, {
"id": "0981747259",
"name": "Yahoxcvxcvo!  Electronics"
}, {
"id": "0981090795",
"name": "yahoo!inc-Geneva"
}, {
"id": "0981803977",
"name": "Yahccxvoo! ut 175 HU"
}, {
"id": "9801803947",
"name": "Yahoo! Spadolini 7 Floor 9IT"
}, {
"id": "8902161968",
"name": "Yahoo! 2 BallycoolinIE"
}, {
"id": "891803984",
"name": "Yahoo! Maria de Molina 4 ES"
}, {
"id": "1667553981",
"name": "Yahoo! Europe Ltd. Bus IE"
}, {
"id": "090981817239",
"name": "Yahoo! Deutsc hlaGmbH-
}, {
"id": "160q324262",
"name": "Yahoo! Inc."
}, {
"id": "1722434322343239",
"name": "Yahvvcxoo! Pte. Ltd."
}, {
"id": "182342312775",
"name": "Yahoo!"
}, {
"id": "108453960",
"name": "Yahoo-Oogzxczaki"
}, {
"id": "1051345196",
"name": "Yahoo-Otesdfmachi"
}, {
"id": "2328134562",
"name": "Yahoo-Shinsfdgfdghirakawa"
}, {
"id": "3451501857",
"name": "Yaxzxcvhoo-Kitadfgfdgkyushu"
}, {
"id": "341848413",
"name": "YahXcxzoo! Dfdgdfg Telecity"
}, {
"id": "341083895",
"name": "Yahoo -Bangalore-s Embassy Golf L"
}, {
"id": "341056349",
"name": "Yahoo sdfs sdf1"
}, {
"id": "1345989963",
"name": "Yafsdfhoo - sdfds sdf"
}, {
"id": "13443501857",
"name": "Yahosdfo-Kitasdfsdskyushu"
}, {
"id": "134435920944",
"name": "yahoo-otemasdsdfsdfchi"
}, {
"id": "1345083960",
"name": "Yasdfsd-Oogsdfdsfaki"
}, {
"id": "134543723239",
"name": "Ysdf! Asia Pasdfsdfdscific Pte. Ltd."
}, {
"id": "1435430946",
"name": "sdfahsdfoo TPsdfdsfdsf2- Taiwan"
}, {
"id": "2341036582",
"name": "sdfahoo-Taisdfsdfdsfwan"
}, {
"id": "234231476048",
"name": "Yahoo TsdfsdfW1"
}, {
"id": "2341075192",
"name": "Ya324hoo! CsdfdsfH1"
}, {
"id": "2341090795",
"name": "ysehjjahoo!inc-Gesdsdfneva"
}, {
"id": "2341075192",
"name": "hoosdf! CHsdfsdfs1"
}, {
"id": "2341604262",
"name": "Yaklkohoo! sdfsdfsdInc."
}, {
"id": "2342418363",
"name": "dsfklYophoo! Inc. sdfdsf- Playsdfdsa Vista"
}, {
"id": "767561835274",
"name": "Yahoo! Inc.Nsdfsdew York111sdfsdf W 40th dsfSt Fl 12US"
}, {
"id": "4651729554",
"name": "Yahoo! Asia Pasdfdsfcific Pte. Ltd"
}, {
"id": "564561747259",
"name": "Yahoo! C/Ofgdfg fdgfd Electronics"
}, {
"id": "4564561430947",
"name": "Yahoo! Inc.xvxcvxc Asia"
}, {
"id": "1591185",
"name": "Yahsdfsdfoo! Inc. vbvcbvcb- Josdfrdan"
}, {
"id": "1430946",
"name": "Yafsdfhoo TP2xcvcxvcxv- Taiwan"
}, {
"id": "1828174",
"name": "yahoo TW1"
}, {
"id": "4564561559154",
"name": "Yasdfsdfhoo! Inc. xcvcxvcxAsia-Seoul"
}, {
"id": "644561355007",
"name": "Yahsdfoo! Eursdfope Ltdxcvcx.-Dublin 3-Esdfast Posdfint B usinedsfdsfss Park"
}, {
"id": "4564561723239",
"name": "Yasdfhoo! Asdfssia Pazxcxzccific Pte. Ltd."
}, {
"id": "24545632452130418",
"name": "YAasdasdHOO! INCzxcxzc. TW1"
}, {
"id": "1234234576291",
"name": "Yasdhoo! Inczxcxzc. Asia"
}, {
"id": "1234243058246",
"name": "Yaasdhoo Europzxcxzce HQ"
}, {
"id": "245232092103",
"name": "Yaasdsadhoo-Hong zxcxzcKong"
}, {
"id": "42342229677",
"name": "Yaasddsahoo! Inc.New York229 West 43rd St US"
}, {
"id": "2341070121",
"name": "Yaasdhoo! Inc.-Dublin."
}, {
"id": "342341434605",
"name": "Yaasdsadhoo! GmbHHasdfmburgSuederstra DE"
}, {
"id": "2342341452ertre675",
"name": "Yddsaahoo Singapxzcxzcxzcxzore (S) Ptzxcxze Ltd"
}, {
"id": "1809ertret814",
"name": "Yasdsadahoo! IndiazxcxzcxzcR&D"
}, {
"id": "151ertret4892",
"name": "Yasadasdhoo Richaxczxcxzczxcrdson"
}, {
"id": "10760ertert3481",
"name": "Yasfdhoo Muzxcxzczxcsic"
}, {
"id": "184dfdg8413",s
"name": "Yagfasdsafhhoo! Dubzczxcxzczlin x- C/O Telecfdsfity"
}, {
"id": "1476fv048",
"name": "Yasddsaahoo TW1"
}
]
},
"groups": {
"count": 2,
"rows": [{
"id": "YAdfgfdgHOO DXB",
"name": "YAfdgfdgfdHOO DXB"
}, {
"id": "dfgINC",
"name": "YAHdfgfdgfdOO! INC"
}]
}
}

AngualrJS - Pagination from list from array and NG Repeat

AngualrJS - Pagination from list prev,next,first,last, ngpeat array:
=================================-=======

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

  <head>
    <link data-require="bootstrap-css@*" data-semver="3.3.1" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
    <script data-require="angular.js@*" data-semver="1.3.15" src="https://code.angularjs.org/1.3.15/angular.js"></script>
    <script data-require="ui-bootstrap@*" data-semver="0.12.1" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.12.1.min.js"></script>

    <script>
var todos2 = angular.module('myapp', ['ui.bootstrap']);

todos2.controller('TodoController', function($scope) {
   $scope.filteredTodos = []
  ,$scope.currentPage = 1
  ,$scope.numPerPage = 10
  ,$scope.maxSize = 100;
  

    $scope.todos = ["Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yarethoo","Yahsdfosdoi","Ysdadhoo","sdYsdahou","nnYanhnion","fgYaoo FR","Yahoo! 125 ","yahoo!incn","YAHO! DBLIN ECITY",
"Yahodfgo!dria47 Bd AU","Yahoo -639 Gars Road","Yahosdfo! Issdfrael Rese 30"];
    
  
  $scope.$watch('currentPage + numPerPage', function() {
    var begin = (($scope.currentPage - 1) * $scope.numPerPage)
    , end = begin + $scope.numPerPage;
    
    $scope.filteredTodos = $scope.todos.slice(begin, end);
  });
});

</script>


  </head>

  <body ng-controller="TodoController">
    <h1>Todos</h1>
    <h4>{{todos.length}} total</h4>
    <ul>
      <li ng-repeat="todo in filteredTodos track by $index">{{todo}}</li>
    </ul>
    <pagination  ng-model="currentPage" total-items="todos.length" max-size="maxSize" boundary-links="true">
    </pagination>
  </body>

</html>
,

Redux vs Redux Toolkit vs React Context

  These are often confused. Feature Redux Redux Toolkit Context API Purpose State management Simplifies Redux Shares values in Rea...