Concat string in 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.str1 = 'Hello'; $scope.str2 = 'World!'; $scope.result = ''; $scope.joinStr= function() { $scope.result = $scope.str1.concat($scope.str2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <input type="button" ng-click="joinStr()" value="Click To Join"></br> <p>Result = {{result}}</p> </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.str1 = 'Hello'; $scope.str2 = 'World!'; $scope.result = ''; $scope.joinStr= function() { $scope.result = $scope.str1.concat($scope.str2); }; }); </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <input type="button" ng-click="joinStr()" value="Click To Join"></br> <p>Result = {{result}}</p> </div> </div> </body> </html>
Copyrights@tutorialsplane.com