Creating a modal window to load data with AngularJS

前端 未结 4 1109
时光取名叫无心
时光取名叫无心 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:37

    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.

提交回复
热议问题