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

Make ui-sref accept objects and not only Strings #900

Closed
mgonto opened this issue Feb 18, 2014 · 6 comments
Closed

Make ui-sref accept objects and not only Strings #900

mgonto opened this issue Feb 18, 2014 · 6 comments
Milestone

Comments

@mgonto
Copy link

mgonto commented Feb 18, 2014

Hey,

Sometimes we actually want to link to another state based on a value on scope and not only by text.

I think it might be a good idea to make ui-sref accept values and call $eval on it. I created my own directive for this. You may want to use something similar. I can PR this as well to your code if you guys want.

https://github.com/mgonto/mgo-ui-router-goto/blob/master/uiGoto.js

Thanks!

@timkindberg
Copy link
Contributor

You mean the params right? Yeah I'm thinking we should split ui-sref into two directives (like we already did for the new ui-sref-options directive), ui-sref for the state name and ui-sref-params for the params object. It would be a breaking change but probably worth it.

@mgonto
Copy link
Author

mgonto commented Feb 20, 2014

Sorry for not being clear. Yeah, I meant the params. You can look at my code, it's actually really simple to implement the $eval on the params object :).

It'd be a breaking change but totally worth it. It makes sense that params aren't "hardcoded string" and actual scope objects IMHO.

Thanks!

@timkindberg
Copy link
Contributor

@nateabele I'm fine with this breaking change. Are you?

@mgonto if nate is fine with it, would you want to submit a pull request (with tests, etc)?

@mgonto
Copy link
Author

mgonto commented Feb 20, 2014

@nateabele hey nice to talk to you again :).

I'll check and if it's short I'll do the PR now :). I'm going on vacations next week so I'll see if it can be done quickly.

Thanks!

@timkindberg
Copy link
Contributor

Ok that's fine. Cool.

nateabele added a commit that referenced this issue Aug 19, 2015
 - Refactor StateRefDirective for better modularity
 - Drop key restrictions on ui-sref-opts
 - Improves performance over prior implementation with no extra $eval()’s

Fixes #395, #900, #1932
nateabele added a commit that referenced this issue Aug 19, 2015
 - Refactor StateRefDirective for better modularity
 - Drop key restrictions on ui-sref-opts
 - Improves performance over prior implementation with no extra $eval()’s

Fixes #395, #900, #1932
@christopherthielen
Copy link
Contributor

Fixed in 3831af1

@christopherthielen christopherthielen added this to the 0.2.16 milestone Aug 19, 2015
ExpFront pushed a commit to ExpFront/ui-router that referenced this issue Jun 23, 2016
 - Refactor StateRefDirective for better modularity
 - Drop key restrictions on ui-sref-opts
 - Improves performance over prior implementation with no extra $eval()’s

Fixes angular-ui#395, angular-ui#900, angular-ui#1932
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

No branches or pull requests

3 participants