$stateParams problem - Cannot read property of undefined


#1

I have ?catid=123 on a page. But when I access it using $stateParams.catid in the same controller as that page, I get TypeError: Cannot read property 'catid' of undefined

Why is that?


#2

Have you injected $stateParams object?


#3

#4

Yes I do have that…


#5

You do have what? How can we help you unless you share some of your code with us, in this case mentioned controller code.