In the process of developing a Single Page Application (SPA), I have encountered an issue with an HTML element calling an AngularJS controller.
Here is what I need:
I want the controller to check for a specific cookie: - If the cookie exists, call a service - If not, display a modal window with some questions that will be stored in cookies when the user clicks "save" in the modal
While I have successfully checked for the cookie in the controller, I am struggling to show the modal to the user.
I have already designed an HTML template (partials/question.html) using Twitter Bootstrap modal, but I am unable to present this modal (HTML) to the user.
I attempted to use the modal service provided by AngularJS, however, I faced limitations in replicating the same HTML template through it (it functions, but lacks a visually appealing UI).
Any recommendations or snippets of code for reference would be greatly appreciated.
Edit missing code :
var modalInstance = $modal.open({
templateUrl: 'partials/questionaire.tpl.html',
controller: 'QuestionaireController',
size: 'lg',
windowClass: 'modal-fit',
resolve: {
questionaires: function () {
return $scope.questionaires;
}
}
});
'partials/questionaire.tpl.html'
===
<div class="modal fade" id="questionaireModal" tabindex="-1" role="dialog" aria-labelledby="questionaireModalLabel" aria-hidden="true" ng-controller="QuestionaireController as questionaireCtrl">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
....
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
...
</div>
</div>
</div>
</div>
Thanks! AJ