Creating a modal window to load data with AngularJS

前端 未结 4 979
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 18:03

I\'ve been trying to load data inside a modal window using AngularJS but I\'m not sure how to do that. I need the url also to change when the link is clicked and the data to loa

4条回答
  •  被撕碎了的回忆
    2021-02-19 18:50

    If you happen to be using Twitter BootStrap's modal, this jsfiddle keeps the Angular components separate, which allows you to create a partial html file with only your modal's html and properly scoped bindings.

    This means you can use an Angular directive declaratively in your html:

     Open MyModal 
    

    Edit: Per @DanDoyon's (correct) comment, the directive was renamed to a non-ng namespace. Update: Using a Bootstrap 3 modal with Angular 1.x makes a custom directive or angular-ui modal pretty much unnecessary.

提交回复
热议问题