I am trying to add url action in c8yActionsProvider in AngularJS plugin and I need to use showIf property which is showing action no matter what value of property is.
This is my code:
Just to narrow down your issue:
The function you’ve specified under showIf is actually being called?
If you check the userService, you are actually getting an instance of that service?
And putting a static return true or return false into the function does not influence whether the action is shown or not?
Has this been previously working? Or is this something you are newly developing? If this was previously working, can you give us the version number this was previously working with?
For all new developments we would strongly recommend using Angular instead of AngularJS.
Yes, method is being called and I am getting instance of userService.
Static return true and false does not influence whether the action is shown or not.
In previous version 10.15.0.309 we had different code:
13822.b151e8336d7a4400fc99.js:2 ERROR Error: [$injector:unpr] Unknown provider: eProvider <- e
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=eProvider%20%3C-%20e
at 82529.445172b1b85ae230caaa.js:2:3550069
at 82529.445172b1b85ae230caaa.js:2:3573623
at Object.s [as get] (82529.445172b1b85ae230caaa.js:2:3575201)
at 82529.445172b1b85ae230caaa.js:2:3573710
at s (82529.445172b1b85ae230caaa.js:2:3575201)
at l (82529.445172b1b85ae230caaa.js:2:3575506)
at Object.invoke (82529.445172b1b85ae230caaa.js:2:3575594)
at action (82529.445172b1b85ae230caaa.js:2:6092944)
at e.value (89887.02e3c264674b3b8c30a3.js:2:450386)
at e_div_3_ul_5_ng_container_1_li_2_Template_button_click_1_listener (ɵcmp.js:27:15)
which I fixed with code from my first comment.
showIf wasn’t working in that version also but we just discovered that issue in new version.
This is legacy code from couple years ago that is the only reason why is in AngularJS.
So it seems like showIf is not supported for the actions. showIf is only used when using this functionality in combination with actionBar: true.
So e.g.: