angular.isString
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) { var a = 'hi'; var b = 100; $scope.result1 = ''; $scope.result2 = ''; $scope.chackStr = function() { if(angular.isString(a)){ $scope.result1 = 'String'; }else{ $scope.result1 = 'Not a String'; } if(angular.isString(b)){ $scope.result2 = 'String'; }else{ $scope.result2 = 'Not a String'; } } }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <button ng-click ="chackStr()" >Check String</button> <br> Result for a = {{result1}}<br> Result for b = {{result2}} </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) { var a = 'hi'; var b = 100; $scope.result1 = ''; $scope.result2 = ''; $scope.chackStr = function() { if(angular.isString(a)){ $scope.result1 = 'String'; }else{ $scope.result1 = 'Not a String'; } if(angular.isString(b)){ $scope.result2 = 'String'; }else{ $scope.result2 = 'Not a String'; } } }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <button ng-click ="chackStr()" >Check String</button> <br> Result for a = {{result1}}<br> Result for b = {{result2}} </div> </div> </body> </html>
Copyrights@tutorialsplane.com