Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

docs(modals): $modalProvider.options is undocumented #1759

Closed
nkpz opened this issue Feb 6, 2014 · 4 comments
Closed

docs(modals): $modalProvider.options is undocumented #1759

nkpz opened this issue Feb 6, 2014 · 4 comments

Comments

@nkpz
Copy link
Contributor

nkpz commented Feb 6, 2014

For a while I thought it was impossible to set global defaults. Even a google search for modalProvider.options is lacking helpful info. I think it would be helpful for others to know how this works. A simple snippet like this would suffice:

angular.module('myApp')
  .config(['$modalProvider', function($modalProvider) {
    $modalProvider.options = {
      backdrop: 'static'
    };
  }])

I can try to find time to submit a PR for this sometime before the end of the week

@pkozlowski-opensource
Copy link
Member

@nnpp a PR would be awesome!

@beardedlinuxgeek
Copy link

Options aren't parsed, so if you do

$modalProvider.options = {
    backdrop: 'static'
};

Then you remove

$modalProvider.options.keyboard = true;

You have do set options individually like

angular.module('myApp')
    .config(['$modalProvider', function($modalProvider) {
        $modalProvider.options.backdrop = "static";
    }])

On a related note, why is the modal provider written like

.provider('$modal', function () {
    var $modalProvider = {
        ...
    };
    return $modalProvider;
});

rather than using this like in the tooltip provider? Would modalProvider be better off written in the style as tooltipProvider?

@abobwhite
Copy link

+1 on this. This was very confusing and it a search through the repo issues yielded something with modalConfig which was supposedly added in v.0.12.0 but it is nowhere to be found.

This method does work - thank you!

@seiyria
Copy link

seiyria commented Apr 15, 2015

+1 -- just needed this, glad I found this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants