var app = angular.module('app', []); app.controller('myController', ['$scope', function($scope) { $scope.countryName = 'India'; $scope.Country = function(name) { $scope.countryName = name; }; $scope.countryCulture = function(name, culture) { $scope.countryName = name; $scope.culture = culture; }; }]);
<body> <h2>Attach functions or behavior - AngularJS</h2> <div ng-app="app" ng-controller="myController"> Click <button ng-click="Country('India')">India</button> <button ng-click="Country('China')">China</button> <button ng-click="Country('Japan')">Japan</button> <button ng-click="countryCulture('Pakistan', ' and I have AK47 ')">Pakistan</button> <p>I am from {{ countryName}} {{ culture }} </p> </div> </body>