process function detailsort function ab return parseFloat acgpa parseFloat

Process function detailsort function ab return

This preview shows page 10 - 16 out of 20 pages.

$scope.process= function () {detail.sort( function (a,b){ return parseFloat (a.cgpa)- parseFloat (b.cgpa)}) if ($scope.sub!= '' && $scope.marks!= '' &&$scope.fname) { $scope.detail.push({ name :$scope.fname , sub :$scope.sub, marks :$scope.marks}); $scope. error = '' ; } else { $scope. error = 'please fill all the fields' ; } } }); </ script > </ html >
Image of page 10
4. Develop a angular JS application as the one given below <html> <head> <title>Angular JS Modules</title>
Image of page 11
} table tr:nth-child(even) { background-color: #ffffff; } </style> <script> var mainApp = angular.module("mainApp", []); mainApp.controller("studentController", function($scope) { $scope.student = { firstName: "Mahesh", lastName: "Parashar", fees:500, subjects:[ {name:'Physics',marks:70}, {name:'Chemistry',marks:80}, {name:'Math',marks:65}, {name:'English',marks:75}, {name:'Hindi',marks:67} ], fullName: function() { var studentObject; studentObject = $scope.student; return studentObject.firstName + " " + studentObject.lastName; } }; });</script> </head> <body> <h2>AngularJS Sample Application</h2> <div ng-app = "mainApp" ng-controller = "studentController"> <table border = "0"> <tr> <td>Enter first name:</td> <td><input type = "text" ng-model = "student.firstName"></td> </tr> <tr> <td>Enter last name: </td> <td><input type = "text" ng-model = "student.lastName"></td> </tr> <tr> <td>Enter Fees:</td> <td><input type = "text" ng-model = "student.fees"></td> </tr>
Image of page 12
Image of page 13
5. Develop an application that displays the following Shopping cart. It should calculate the amount based on the quantity given by the user. When the user clicks the remove button, the particular item should get removed from the cart. <!DOCTYPE html> <html> <head> <title>shopping list</title> <script src=""></script> <style type="text/css"> div {
Image of page 14
Image of page 15
Image of page 16

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture