Ng-Submit-7

 

Ng-Submit-7

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Welcome to LearnKode - A code learning platform</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="app"> <div ng-controller="ExampleController"> <div class="container"> <h3>Add Rows</h3> <form ng-submit="save()"> <div ng-repeat="row in list"> <input type="text" class="form-control" ng-model="row.text" /> </div><br /> <input type="button" class="btn btn-primary" ng-click="list.push({})" value="Add Row" /><button class="btn btn-default">Submit</button> </form> <br> <pre ng-show="isShow">list={{savedData}}</pre> </div> </div> <script> var app = angular.module("app", []); app.controller('ExampleController', ['$scope', function ($scope) { $scope.list = [{ text: "LearnIt" }]; $scope.save = function () { $scope.isShow = true; $scope.savedData = angular.copy($scope.list); }; }]); </script> </body> </html>
Output