So right now in my urlparams settings i have it set up like key:value, and it works fine, whenever there is a value in a parameter its set in a component, take a filter for example, and works as intended.
Right, now it happens that i have a large amount of parameters set up, so i need to hide those that dont have a value assigned to them, so i try this:
{{ filter.value ? "parameterName" : null}} i see the parameter in the url, and has the correct value, but when I try or a colleague try to open that url I gave with the parameter showing and the correct value, when the app loads, it doesnt set the filter value.
Im kind at a loss right now, all of this is done editor mode, not the released app.
The first one works as intended, the second doesnt.
I think this is a case of interpretation when the page is loading - the first one may work because it's actually a string whereas the second may not be "defined" on page load...perhaps using localStorage may solve your issue.
I thought of that while looking for answers, whats bugging me is the fact that people just have it set up just with the conditional (or so i think), without using anything else, and works for them, thats why i wanted to ask before trying other approaches in case i was doing something wrong.
I dont think i follow ur question, i just noticed that the pictures and what i explained could be missinterpreted, so just in case i will explain it better.
With:
currentView {{mainContainer.currentViewKey}} it works as intended, the param appears in the url, the value also appears and is correct and when i load the page with a URL that has that parameter, it modifies the value and, in this case, shows the correct view.
The first picture contains the urlparams.
With:
{{ artifactLicensedFilter.value. ? "artifactLicensedFilterValue" : null }} {{ artifactLicensedFilter.value }} the parameter appears in the URL, it has teh correct value, but when i load a page with the URL, the app doesnt work as intended.
Basically i have a bunch of parameters, filters and such, that i want to hide in the url if there is no value set to it, if i dont use conditional the url would look something like "currentView=" and that would look ugly and wrong.
Thats basically the reason for using that.
The second picture is the setting that should set the value that comes in the urlparams.hash to the value of the filter in this case.
I wouldn't really worry about what the url looks like to be honest. And I am not sure if what you are trying to do can be done or is supported - to my first point...
I am not familiar with other users setting the key's name via a ternary, if you have any links to that I would love to check that out. I assumed it might only be possible to have the value of a key be set via a ternary operator.
If the first option with currentView {{mainContainer.currentViewKey}} works as intended, I think that should be fine. If you want to keep the URL short and to ignore the values that are not set/defined yet, local storage or maybe hash params could be viable options as well!