I have an old angularjs project that I needed to make some changes to and happen upon this issue.
I have this ui-sref link, where dynamicParam can often lead with a 0.
<a ui-sref="mystate({query: {{vm.dynamicParam}}})">anchor</a>
But the rendered link get the lead zero removed.
<a ui-sref="mystate({query: 058899112112})" href="/mystate/?query=58899112112">anchor</a>
Can I ensure that the href will include the leading 0 ?
It is because your {{vm.dynamicParam}} is a number, you should convert dynamic param to string by using .toStirng() function or by adding "" at the end of your dynamic param where you set it inside your controller. As another option inside your html you can use ng-init which would call a function that would convert your dynamic param int to string or you can directly call that function from your ui-sref.