javascript - Use angular js controller to check a cookie and return a modal -


i implementing spa wherein have html element calls angularjs controller.

here requirement:

i wish check in controller whether there specific cookie available: - if yes, call service - if not, return modal (with questions wish store in cookies when user clicks "save" in modal)

till able check cookie in controller not able show modal user.

i have created html template (partials/question.html) using twitter bootstrap modal, not able return modal (html) user.

i tried modal service of angularjs hit bottom of not able create same html template using same (it works not cool ui).

any suggestion or code snippet use reference great help.

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 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

i doing stupid.

the issue above was creating modal (using modal-dialog , modal-content class of bootstrap) , passing above template $modal service return view on condition.

once remove modal-dialog template, worked charm.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -