Description
includedByState
improvement proposition
tldr;
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 is fullOrPartialStatename
(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
and options
are given to the other method.
I may open a PR soon, but let me know what you think about it?