yukatan / commangular

Command framework for AngularJS
MIT License
83 stars 8 forks source link

commangular is on the window #3

Closed kobrigo closed 9 years ago

kobrigo commented 10 years ago

To define a command I have to use the commangular object/namespace that is set on the window. why is that? I would rather have the contribution of commands through the provider as well. What problems did you encounter that made you place it outside of angular and on the main window?

kobrigo commented 10 years ago

Is it ok if I create a pull request that changes the $commangularProvider to include all the functionality of the window.commangular?

yukatan commented 10 years ago

Hi,

One problem I see if you include all the commangular namespace inside the $commangularProvider is you will need to create a config block everytime you need to create a command, because you need access to the $commangularProvider.

The second one is that Angular config blocks are used to config your application at startup. I don't see any reason to write your command bussines logic inside a config block. (This a personal design decision. What do you think?)

It would be posible because angular execute config blocks in the same order they are registered, but I dont think is a good design. I prefer to keep a commangular namespace.