Skip to content

Instantly share code, notes, and snippets.

@AnishLushte07
Last active July 19, 2019 12:45
Show Gist options
  • Save AnishLushte07/9f2919ecc74eed4e419ea837be11336d to your computer and use it in GitHub Desktop.
Save AnishLushte07/9f2919ecc74eed4e419ea837be11336d to your computer and use it in GitHub Desktop.
Candidate UI
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<body>
<script>
var app = angular.module("candidateApp", []);
app.controller("myCtrl", function($scope, $http) {
$scope.submit = function (form) {
if (form.$invalide) return;
$http.post('http://candidate.cogencis.com/api/candidate', $scope.data)
.then(res => alert('Record saved successfully.'))
.catch(err => alert('Something went wrong.'));
}
});
</script>
<div ng-app="candidateApp" ng-cloak ng-controller="myCtrl" class="container">
<div class="text-center">
<h1>Cogencis User Registration</h1>
<h5>Fill up the form with correct values.</h5>
</div>
<form class="form-horizontal" name='candidateForm' ng-submit='submit(candidateForm)' validate style="margin-top: 30px;">
<div class="form-group">
<label class="control-label col-sm-2" for="name">Name:</label>
<div class="col-sm-10">
<input type="text" ng-model='data.name' required class="form-control" id="name" placeholder="Enter full name">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" ng-model='data.email' required class="form-control" id="email" placeholder="Enter email">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="mobile">Mobile Number:</label>
<div class="col-sm-10">
<input type="number" ng-model='data.mobile' required class="form-control" id="mobile" placeholder="Enter mobile number">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="source">Source:</label>
<div class="col-sm-10">
<input type="text" ng-model='data.source' class="form-control" id="source" placeholder="Enter source">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="referredBy">Referred By:</label>
<div class="col-sm-10">
<input type="text" ng-model='data.referredBy' class="form-control" id="referredBy" placeholder="Enter reference">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="interviewLocation">Interview Location</label>
<div class="col-sm-10">
<input type="text" ng-model='data.interviewLocation' class="form-control" id="interviewLocation" placeholder="Enter interview location">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="interviewDate">Interview Date:</label>
<div class="col-sm-10">
<input type="date" ng-model='data.interviewDate' class="form-control" id="interviewDate" placeholder="Enter interview date">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment