This commit is contained in:
resicovenba 2017-11-30 19:52:24 +05:30
commit 547a9a4ebd
2 changed files with 4 additions and 2 deletions

View File

@ -136,6 +136,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
swal("Success!", response.data.message, "success");
$state.go($state.current, {}, {reload: true});
} else {
$scope.addMoreItems.splice($scope.addMoreItems.length-1);
$scope.ldloading1[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
}

View File

@ -156,12 +156,13 @@
</label>
<input type="text" placeholder="Enter Course ID"
tabindex="2" class="form-control" name="coursecode"
tabindex="2" class="form-control" name="coursecode" ng-maxlength="20"
ng-model="myModel.courseCode" ng-pattern="/^[a-zA-Z0-9\s]*$/" required/>
<span class="error text-small block"
ng-if="Form.coursecode.$dirty && Form.coursecode.$error.required">Course id is required</span>
<span class="error text-small block"
ng-if="Form.coursecode.$dirty && Form.coursecode.$error.pattern">Invalid course id </span>
ng-if="Form.coursecode.$dirty && Form.coursecode.$error.pattern || Form.coursecode.$error.maxlength ">Invalid course id </span>
</div>