| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1× | angular.module('selectDemoValidation', ['ngMaterial', 'ngMessages'])
.controller('AppCtrl', function($scope) {
$scope.clearValue = function() {
$scope.quest = undefined;
$scope.favoriteColor = undefined;
$scope.myForm.$setPristine();;
};
$scope.save = function() {
if ($scope.myForm.$valid) {
$scope.myForm.$setSubmitted();
alert('Form was valid.');
} else {
alert('Form was invalid!');
}
};
});
|