python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
AngularJs CRUD Operations demo example

AngularJs CRUD Operations demo example

The CRUD Operations demo link

The example in detail as given below

<!doctype html>
    <script src=""></script>
        var app = angular.module('empApp', []);

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

            //Employee collection for render grid.
            $scope.employee = [{
                id: 1,
                name: 'Anil Singh',
                age: 30,
                web: ''
            }, {
                id: 2,
                name: 'Sunil Singh',
                age: 25,
                web: ''
            }, {
                id: 3,
                name: 'Sushil',
                age: 20,
                web: ''
            }, {
                id: 4,
                name: 'Aradhya',
                age: 2,
                web: ''
            }, {
                id: 5,
                name: 'Reena',
                age: 25,
                web: ''

            //Delete Row
            $scope.delete = function (index) {
                $scope.employee.splice(index, 1);
                //TODO: Login for server call and remove data;

            //Update Row
            $scope.update = function (index, data) {
                //TODO: logic to render data on popups and update and set;

            //Copy new Row
            $scope.copy = function (index, data) {
                var newRow = angular.copy(data);
                //TODO: Logic for add new rows.
<body ng-app="empApp" ng-controller="empCtrl">
        <h3>Id : Name : Age : Web</h3>
    <div ng-repeat="emp in employee">
            {{}} : {{}} : : {{emp.age}} : : {{emp.web}}
            <input type="button" value="Update" data-ng-click="update($index, emp)" />
            <input type="button" value="Copy" data-ng-click="copy($index, emp)" />
            <input type="button" value="delete" data-ng-click="delete($index)" />

The output look like


Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions