dwmkerr / angular-modal-service

Modal service for AngularJS - supports creating popups and modals via a service.
MIT License
626 stars 321 forks source link

Default `appendElement` #192

Closed elliottregan closed 7 years ago

elliottregan commented 7 years ago

If there isn't a way to set a default appendElement, that would be a great feature. It is probably pretty common that if you define a particular appendElement element that you will always want to append to that element.

wojo1206 commented 7 years ago

By default modal is appended into body. Change body var for your need in angular-modal-service.js:46

//  Get the body of the document, we'll add the modal to this.
var body = angular.element( $document[0].body ); 
elliottregan commented 7 years ago

@wojo1206 That would work, but then I would need our own fork of angular-modal-service and couldn't keep it updated with bower.

dwmkerr commented 7 years ago

This is available, see appendElement at: https://github.com/dwmkerr/angular-modal-service#showmodal-options