events – OnlineWebTutorial.Com

Events – AngularJS

AngularJS provides event directives. There are some common events provided by AngularJS to use in HTML. ng-mousedown – (onmousedown in javascript) ng-mouseenter – (onmouseenter in javascript) ng-mouseleave – (onmouseleave in javascript) ng-mousemove – (onmousemove in javascript) ng-mouseover – (onmouseover in javascript) ng-mouseup – (onmouseup in javascript) ng-blur – (onblur in javascript) ng-change – (onchange in javascript) ng-click – (onclick in javascript) ng-copy – (oncopy in javascript) ng-cut – (oncut in javascript) ng-dblclick – (ondblclick in javascript) ng-focus – (onfocus in javascript) ng-keydown – (onkeydown in javascript) ng-keypress – (onkeypress in javascript) ng-keyup – (onkeyup in javascript) ng-paste – (onpaste in […]


Using Forms – AngularJS

AngularJS provides following flags to handle errors and validating the input. $dirty − indicates that value has is changed. $invalid − indicates that value is invalid. $error − gives the specific error. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script> <div ng-app="clickApp" ng-controller="clickCtrl"> <form name = "testFrm" novalidate> Enter name: <input type = "text" name = "tname" ng-model = "tname" required /> <span style = "color:red" ng-show = "testFrm.tname.$dirty && testFrm.tname.$invalid"> <span ng-show = "testFrm.tname.$error.required">Name is empty.</span> </span><br /> <input type = "email" name = "email" ng-model = "email" length = "20" required /> <span style = "color:red" ng-show = "testFrm.email.$dirty && testFrm.email.$invalid"> <span ng-show = […]


Facebook
Google+
Twitter
Visit Us
PINTEREST
LinkedIn