Show pop-ups the most elegant way

后端 未结 5 1326
我在风中等你
我在风中等你 2020-12-02 03:58

I have this AngularJS app. Everything works just fine.

Now I need to show different pop-ups when specific conditions become true, and I was wondering what would be t

5条回答
  •  时光取名叫无心
    2020-12-02 04:35

    Based on my experience with AngularJS modals so far I believe that the most elegant approach is a dedicated service to which we can provide a partial (HTML) template to be displayed in a modal.

    When we think about it modals are kind of AngularJS routes but just displayed in modal popup.

    The AngularUI bootstrap project (http://angular-ui.github.com/bootstrap/) has an excellent $modal service (used to be called $dialog prior to version 0.6.0) that is an implementation of a service to display partial's content as a modal popup.

提交回复
热议问题