I have been trying to make use of the param types with ui-router and can't seem to get them right.
$stateProvider.state({
name: 'home.foo',
url: '/foo/{isBar:bool}',
controller: function() { },
templateUrl: 'foo.html'
});
My expectation is that I should be able to transition to that state like this:
$state.go(home.foo, { isBar: false })
or
ui-sref="home.foo({ isBar: false })"
however in the resulting $stateParams you will see isBar: true
Looking at the way the 'bool' param type is written I suppose true/false should be encoded as 0/1 on the url but this doesn't happen. If use 0/1 in the params for $state.go then it works and is decoded as false/true but to further confuse the issue this doesn't work if using the ui-sref.
Hopefully this plunker will explain it better. Any hints appreciated!
Edit: My goal in using the bool param type is to end up with a boolean data type in $stateParams