Here we are using
ng-click directive to change the name when the mouse is clicked on the paragraph, we have declared function as
clickhere() and we declared firstname as manideep and function clickhere performs changing name when we click on the paragraph and shows the value which we declare.
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<p ng-click="clickhere()">{{firstname}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
$scope.firstname = "Manideep";
$scope.clickhere = function () {
$scope.firstname = "Goud";
}
});
</script>
</body>