<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>ng-click in AngularJs</title>
    <script src="https://code.angularjs.org/1.4.1/angular.js"></script>
    <script>
        var app = angular.module('myApp', []);
        app.controller('ngClickCtrl', ["$scope", function ($scope) {
            $scope.domain = "code-sample.com";
            $scope.IsDisplay = false;
            $scope.clickMe = function (clicked) {
                    alert(" My Click function is called.");
                $scope.IsDisplay = clicked == true ? false : true;
            };
        }]);
    </script>
</head>
<body ng-app="myApp">
    <div ng-controller="ngClickCtrl">
        <div><h2>ng-click in AngularJs</h2> </div>
        <div>
            Domain name: <input type="text" ng-model="domain"> <button type="button" ng-click="clickMe(IsDisplay)">NG-CLICK</button>   
        </div>
        <div>
            <div ng-show="IsDisplay"> My Click function is called. <br /><h3 style="color:green;">Display User detail: {{domain}} </h3></div>
        </div>
    </div>
</body>
</html>
// Code goes here

/* Styles go here */