Creating a modal window to load data with AngularJS

前端 未结 4 1135
时光取名叫无心
时光取名叫无心 2021-02-19 18:17

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

    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.

提交回复
热议问题