I'm using ng-disabled in my view like this I have truthy conditions
md-button.md-primary.md-raised flex="20" ng-disabled="form.$invalid || form.$pristine || day == 0 || leaveapplication.reason == null" ng-click="save(starts_on, ends_on, leave_type_id, period1, period2)" Apply
So I'm gonna use function in my ng-disabled this time:
md-button.md-primary.md-raised ng-disabled="buttonChecker()" ng-click="save(starts_on, ends_on, leave_type_id)" Apply
Now how can I put my condition in my function like form.$valid and form.$pristine the other condition is easy like day == 0, but the other conditions are hard for me.
formfrom function ?$scope, ex:$scope.formName