String to number Angularjs
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.a = '90'; $scope.b = '10'; $scope.a1 = ''; $scope.b1 = ''; $scope.convertToInt = function() { $scope.a1 = parseInt($scope.a); $scope.b1 = parseInt($scope.b); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <button ng-click='convertToInt()' >Convert & Add</button><br> Before Conversion a + b = {{a + b}}<br> After Converting to Int a1 + b1 = {{a1 + b1}}<br> </div> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.a = '90'; $scope.b = '10'; $scope.a1 = ''; $scope.b1 = ''; $scope.convertToInt = function() { $scope.a1 = parseInt($scope.a); $scope.b1 = parseInt($scope.b); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <button ng-click='convertToInt()' >Convert & Add</button><br> Before Conversion a + b = {{a + b}}<br> After Converting to Int a1 + b1 = {{a1 + b1}}<br> </div> </div> </body> </html>
Copyrights@tutorialsplane.com