<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.3/angular.min.js"></script>
<title>Simple Events</title>
</head>
<body>
<h2>AngularJS Events</h2>
<!-- Click Event -->
<button ng-click="msg='Button Clicked!'">Click Me</button>
<p>{{msg}}</p>
<!-- Blur Event -->
<input ng-model="name" ng-blur="msg2='Input Lost Focus: '+name" placeholder="Type name">
<p>{{msg2}}</p>
</body>
</html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter