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

MessageBox broken after 739f86f21a2919654bcb01f3edc6ddeeb1b35c22 #126

Closed
pkozlowski-opensource opened this issue Feb 7, 2013 · 8 comments

Comments

@pkozlowski-opensource
Copy link
Member

The 739f86f broke message box.

@thiagofelix could you have a look?

pkozlowski-opensource referenced this issue Feb 7, 2013
… $routeProvider.when

Changing the $dialog service to treat the 'resolve' property the same way as $routeProvider does. It means expecting a string or a factory function instead of a value.

Signed-off-by: thiagofelix <[email protected]>
@thiagofelix
Copy link
Contributor

For sure, i'll look right now. There ist'n any testing failing, i will create one to check this condition and commit the source to make it pass.

@pkozlowski-opensource
Copy link
Member Author

@thiagofelix awesome! I'm suspecting that we need to test if an argument passed to an injector is either a function or an array.

@thiagofelix
Copy link
Contributor

@pkozlowski-opensource this feat introduced a breaking change, because we change what a valid resolve object is. The valid assignment to a key in the resolve object could be only a string ( return an instance of the service ) or a function ( Invoke the method and supply the method arguments from the $injector. ).

The previous version accepted that a object could be used, what is the best to do?

  1. Make possible to use a object ( as in the previous version )
  2. Restrict to only string or function ( as $routeProvider.when really does ) and update the documentation and tests

I think the second choice is the best ( even if it introduce a breaking change ) because push the $dialog service to work more similar to the same 'resolving properties' concept existing in angularjs.

@pkozlowski-opensource
Copy link
Member Author

@thiagofelix I'm kind of divided here... On one hand it would be nice to keep the same contract as $routeProvider. On the other hand it is a bit of a pain in a *&@^$@ that I can't provide an object since I need to write a function even if I just want to pass a bunch of values...

@angular-ui/bootstrap What do you guys think?

@SidhNor
Copy link
Contributor

SidhNor commented Feb 8, 2013

I'm for option 2. I'd better have consistent resolve as people are/will be expecting it from previous experience with routeProvider usage.
Not being able to pass an object is a minor inconvenience in my opinion.

@pkozlowski-opensource
Copy link
Member Author

OK, pushed a quick fix updating the resolve syntax to the one used by the routing system. Didn't add tests as both dialog and modal needs to be unified (as well as they tests). See #128

@thiagofelix
Copy link
Contributor

Great! happy to see dialog service working more similar to the framework.
This project is very well designed and implemented.

@pkozlowski-opensource
Copy link
Member Author

@thiagofelix great that you find it useful! Yes, we definitively want to be as close to the AngularJS-philosophy of directives as possible.

And hey, there is no shortage of work for this ambitious project so any contributions are highly welcomed!

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

3 participants