I have a link with handler in HTML:
<div class="menu-item" ng-repeat="pageName in pages">
<a ng-click="routing.open('{{pageName}}')">{{pageName}}</a>
</div>
It triggers the 'open' function in a self-made Angular-UI Routing Factory / helper and sends the 'pageName' as param.
The open method checks if there's a handler or state for loading a view.
var availableStates = $state.get();
if (!pages[name] || availableStates.indexOf(name) === -1) {
alert("State or Loader for state: '{0}' does not exist!".format(name));
return;
}
When clicked the alert shows with this message:

But when I look in the web console, the value has been set properly.

I could use some help with this, what causes this behaviour and how does one fix this?