I am unable to find the error in AngularJS Form validation.
JavaScript:
sidemenu.controller('galleryCtrl', ['$scope', '$rootScope', 'PropertyDetails', '$window', '$location', '$routeParams', 'allServices', 'customVariables', '$mdDialog', function (a, b, p, $window, l, r, e, cust, md) {
var vm = this;
a.imageSlide = true;
vm.user = {
first_name: "",
email_id: "",
selected_id: "",
phone: ""
};
}]);
HTML:
<form name="register_form" novalidate="">
<div class="form-group">
<label>firstName{{register_form.first_name.$pristine}}</label>
<input type="text" name="first_name" placeholder="First Name" ng-model="user.first_name" ng-required="true">
<p ng-show="register_form.user_first_name.$invalid && !register_form.user_first_name.$pristine" class="help-block">You name is required.</p>
</div>
<div class="col-xs-12">
<button type="button" ng-disabled="((!user.phone) || (!user.selected_id))" ng-click="vm.raiseEnquiry(user,selected_id)" class="sell-btn btn-action btn btn-block hpl-btn btn-default">Raise Enquiry</button>
</div>
</form>
I am trying to print this line in above html code is {{register_form.first_name.$pristine}} not printing anything. So I am unable to find that what is the error in this.