javascript - Show pop-ups the most elegant way -


i have angularjs app. works fine.

now need show different pop-ups when specific conditions become true, , wondering best way proceed.

currently i’m evaluating 2 options, i’m absolutely open other options.


option 1

i create new html element pop-up, , append dom directly controller.

this break mvc design pattern. i’m not happy solution.


option 2

i insert code pop-ups in static html file. then, using ngshow, can hide / show correct pop-up.

this option not scalable.


so i’m pretty sure there has better way achieve want.

based on experience angularjs modals far believe elegant approach dedicated service can provide partial (html) template displayed in modal.

when think modals kind of angularjs routes displayed in modal popup.

the angularui bootstrap project (http://angular-ui.github.com/bootstrap/) has excellent $modal service (used called $dialog prior version 0.6.0) implementation of service display partial's content modal popup.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -