<body ng-app='MainApp'>
    <div ng-controller='MainCtrl'>
      <div>
        <input type='button' value='Hello' ng-click='hello(text);' />
        <input type='button' value='Hi' ng-click='hi(text);' />
      </div>
      <div>
        <p>Text: {{text}}</p>
      </div>
    </div>
</body>
var mainMod = angular.module('MainApp', []);

mainMod.controller('MainCtrl', function ($scope) {
    $scope.text = '!!';
     
    $scope.hello = function(text){
         $scope.text = text + 'Hello';
    }
    $scope.hi  = function(text){
      $scope.text = text + 'Hi';
    }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://code.angularjs.org/1.3.8/angular.min.js