Is there a way to put a condition inside an ng-click? Here, I want that the form is not submitted if there are any form errors, but then I got a parse exception.
Template:
<input ng-click="check(profileForm.$valid)" name="submit"
id="submit" value="Save" class="submit" type="submit">
Controller:
$scope.check = function(value) {
if (value) {
updateMyProfile();
}
}
Write as
<input type="submit" ng-click="profileForm.$valid==true?updateMyProfile():''" name="submit" value="Save" class="submit" id="submit">