<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';
}
});
This Pen doesn't use any external CSS resources.