You can check form validation on progress bar if form is valid then display progress bar
HTML Code
<style>
button.st{
padding:5px ;
border:1px solid #ccc;
/* background:green; */
/* border:1px solid lightblue; */
/* color:darkblue; */
margin:10px;
}
.progressbar{
border:1px solid #fff;padding:10px;border-radius:1px;width:60%;margin:10px;background:#999;color:red;
}
p{
margin-left:10px;
}
</style>
<body >
<div ng-controller="MyCtrl">
<p progressbar prog="form1.$valid ? '50':'10'" ></p>
<form name="form1" novalidate>
<p>
<span style="color:blue">1) select One</span><br/>
<input type="radio" ng-model="user.q1" name="grp1" value="A" ng-required="true"/>A
<input type="radio" ng-model="user.q1" name="grp1" value="B" ng-required="true"/>B
<input type="radio" ng-model="user.q1" name="grp1" value="C" ng-required="true"/>C
</p>
<p>
<span style="color:blue">2) select two</span><br/>
<input type="radio" ng-model="user.q2" name="grp2" value="A" ng-required="true"/>A
<input type="radio" ng-model="user.q2" name="grp2" value="B" ng-required="true"/>B
<input type="radio" ng-model="user.q2" name="grp2" value="C" ng-required="true"/>C
</p>
<button class="st" ng-disabled="form1.$invalid"> submit</button>
</p>
</form>
</div>
</body>
</html>
Controller js Code
var app = angular.module('myApp', []);
app.controller('MyCtrl', function($scope) {
$scope.name = 'World';
$scope.name = 'pelase select all fileds';
$scope.progressBar = false;
$scope.progressbarShow = function(){
$scope.progressBar = true;
}
});
app.directive('progressbar', [function() {
return {
restrict: 'A',
scope: {
'progress': '=prog'
},
template: '<div class="stripe" style="background-color: #C7D2D2; height:30px; width:100%;"> <div ng-style="style" style="background-color:#8CD211; height:100%"></div> </div>',
controller: function($scope, $element, $attrs) {
$scope.$watch(function() {
$scope.style = {"width": $scope.progress + "%"}
})
}
}
}])
please check working plnkr http://plnkr.co/edit/y35BnTUG36ChnCSC2YYH?p=preview