I use UI-Router. Here is one of my state that I am heading for ui-sref:
.state("community", {
url: "/community/:community_id",
controller: "CommunityCtrl",
templateUrl: "/static/templates/community.html"
})
In one of my templates, from where I switch to the "community" state:
<div ui-sref="community({community_id: community.community_id})"></div>
Here is my community object:
{
name: 'Community name',
community_id: 11 //int, not a string
}
As you can see, the "community_id" key contains an int value, not a string value. However, when I access this parameter through $stateParams, I get:
community_id: "11"
Why am I getting a string?
source
share