Reputation: 3029
I have a login form as a model and in which I have terms and conditions button and I want to show another model when I click on that terms.Therefore when I click on my terms buttons a html containing terms should be shown.
My html :
<div class="col_full">
<input type="checkbox" ng-class="{'error': submitted && registerLoginForm.terms.$error.required}" name="terms" value="check" id="agree" ng-model="register.terms" required/> I agree to the XpertDox <a href="#" ng-click="termsandPolicy('terms')">Terms of Use</a> & <a href="#" ng-click="termsandPolicy('privacy')">Privacy Policy.</a>
</div>
my terms html is terms-model.html
my js,
$scope.termsandPolicy = function(type){
$timeout(function(){
if(type == 'terms'){
$('#terms-model').modal('show');
}
}, 1000);
}
But I am not sure that where I should include this terms-model. Can anyone help me please ?
Upvotes: 0
Views: 1533
Reputation: 4565
You can use bootstrap modal dialog if u're using bootstrap. Add ng-include in your html like below examples.
Html
<ng-include="'template/terms-model.html'"></ng-include>
terms-model.html
<div id="termsModal" class="modal" role="dialog"
tabindex="-1" aria-labelledby="modalLabel" aria-hidden="false" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<!-- Modal content -->
<div class="modal-content">
<!-- Place ur content here -->
</div>
</div>
</div>
Js
$scope.termsandPolicy = function(type){
// Show modal by Id
$('#termsModal').modal('show');
}
Upvotes: 1