-
Notifications
You must be signed in to change notification settings - Fork 3k
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
includedByState filter not fully working #1735
Comments
Hey @eddiemonge (FYI, I've seen that the same issue will occurs in the 1.0 branch too, so I may push a PR soon if you want) |
Keeping the PR open in case @christopherthielen wants to pull it in to 1.0 |
On mobile but this seems ok to me. |
Link the PR? |
The PR for this is here |
Ok, so here you are for the PR to the |
Add parameters to the $IncludedByStateFilter: - params - options This allows to use more parameters on this filter and not only the fullOrPartialStatename parameter. Thanks to this improvement, the following now works (takes in account the id param): <div ng-show="'**.foo.**' | includedByState:{id: 'new'}">It works</div> Closes angular-ui#1735
includedByState
improvement propositiontldr;
This works:
<div ng-show="'**.foo.**' | includedByState">Work</div>
and this don't.. (doesn't respect the second parameter, shown no matter what
id
is)<div ng-show="'**.foo.**' | includedByState:{id: 'new'}">Do not work</div>
Long version
The downside with it is that it doesn't use all the params from the
$state.includes
function, it only cares about the first one, which isfullOrPartialStatename
(as reported in the doc)Here is a plunker to show it live. In this example you can see that the red message is shown, no matter the params passed to the filter.
The issue come from here in the code as it uses only a single param.
To resolve this, we can easily tweak the method to something like this: Gist, where
params
andoptions
are given to the other method.I may open a PR soon, but let me know what you think about it?
The text was updated successfully, but these errors were encountered: