I'm doing the next thing. I want to enter empty values in input its boundary highlighted (added new class 'warning'). I created the following code.
HTML:
`<body ng-app="TestPage">
<form ng-controller="TestForm">
<input ng-model="testinput" class="form-input" ng-class="testclass" type="text"/>
<button ng-click="submitButton()">Click</button>
</form>
</body>`
JavaScript:
`angular.module('TestPage',[])
.controller('TestForm', function($scope, $animate) {
$scope.submitButton = function() {
if (($scope.testinput == undefined) || ($scope.testinput == "")) {
$animate.addClass($scope.testclass, "warning");
}
};
});`
But the use of the addClass does not work. What am I doing wrong?