johannesjo / angular2-promise-buttons

Chilled loading buttons for angular2
https://johannesjo.github.io/angular2-promise-buttons/#demo
MIT License
86 stars 28 forks source link

[feature] promiseForm #21

Closed mits87 closed 6 years ago

mits87 commented 6 years ago

Hi,

first of all thank you for great plugin! I'm using your plugin mainly in my forms where spinner show when form is submitted. All works fine. I have an idea that you may like. When I'm submitting the form I would like show spinner on button and also block the form / add overlay etc. So maybe good idea will be add new directive eg. promiseForm which will add class for the form?

Thx

johannesjo commented 6 years ago

Hey there! Thanks for reporting! I'll have to investigate this a little further and get back to you.

johannesjo commented 6 years ago

After investigating I found that this might be better implemented in a new directive. To disable a form completely, you need a

wrapper element. You can see an example of this here: https://github.com/johannesjo/ng-fab-form/blob/master/src/ng-fab-form-directive-f.js#L17

mits87 commented 6 years ago

I absolutely agree with you. Will you create the directive to your package?

johannesjo commented 6 years ago

No. I think I'd rather release it as a standalone package. Unfortunately I don't have enough time build a directive like that. If you like to build your own, feel free to use any code of this repository.