Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure timeout duration by a provider #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tomahim
Copy link

@tomahim tomahim commented Sep 15, 2014

Hi,

I really enjoy the work done on postman, it's beautiful and simple.

I needed to change the duration of the timeout, so I propose to add a provider which can be use during the config phase (so it can be extended in the future for others parameters).

Example of use :

angular.module('myApp', []).config(postmanSettingsProvider) {
    postmanSettingsProvider.setTimeout(4500);
});

If you agree with this, can you do the merge ?

Thank you

Hi, 

I really enjoy the work done on postman, it's beautiful and simple. 

I needed to change the duration of the timeout, so I propose to add a provider which can be use during the config phase (so it can be extended in the future for others parameters). 

If you agree with this, can you do the merge ?

Thank you
@@ -9,8 +9,20 @@
if($rootElement[0].tagName !== 'HTML') $rootElement.append($elem);
else angular.element(document.body).append($elem);
}])

.directive('postmanParcels', ['$timeout', function ($timeout) {
.provider('postmanSettings', function() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make it postmanSettingsProvider in the config? Can you not name it the same as the factory and then just access it via name + Provider?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to name it "postman" but postmanProvider is undefined when I use it in the config. I guess it's a conflict with the factory.

@CWSpear
Copy link
Owner

CWSpear commented Sep 15, 2014

I like it 👍

Will you add some docs/usage in the README?

@tomahim
Copy link
Author

tomahim commented Sep 15, 2014

Ok i'm adding some lines to the Readme.

@tomahim
Copy link
Author

tomahim commented Sep 15, 2014

Done for the README

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

Successfully merging this pull request may close these issues.

2 participants