What Will I Learn?
- You will learn Directive ng-submit such as ng-submit="addRow()" is used with form element.
- You will learn Directive ng-repeat such as ng-repeat="company in companies" is used with
element for repeating the entries in companies JSON data as different row. - You will Directive ng-controller such as ng-controller="CompanyCtrl" defines the controller with element.
- You will learn $scope.addRow function is added within CompanyCtrl. The function adds a new element in the companies JSON data using the syntax $scope.companies.push({ 'name':$scope.name, 'employees': $scope.employees, 'headoffice':$scope.headoffice });
Requirements
- Atom Editor
Difficulty
Either choose between the following options:
- Intermediate
Description
Video intent shows dynamically row insertion into table so firstly the employees array is defined and created using the bootstrap table ng-repeat then the necessary inputs are created in the form element to be data entry When the button is clicked, the addRow function is running and the elements in the inputs are pushed to the employees array. finally the inputs are cleared
Video Tutorial
Posted on Utopian.io - Rewarding Open Source Contributors