Creating a modal window to load data with AngularJS

前端 未结 4 982
伪装坚强ぢ
伪装坚强ぢ 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:34

    The Angular way is view watching the model and you changing the model:

    • Put the dialog into the markup.
    • Bind content of the dialog to something like selectedPost.
    • Clicking the link only change selectedPost and hide/show the dialog.

    Here is a very quick version: http://plnkr.co/edit/0fsRUp?p=preview

    Checkout Angular UI, they already have a component for Bootstrap's modal.

提交回复
热议问题