Strange ionic error: Could not resolve 'add-trip' from state 'app.cases'

My UI works fine - it’s a modal that has a slidebox in it - but when I look at the console logs I get this odd error.

“Could not resolve ‘add-trip’ from state ‘app.cases’”

where app.cases is the page you get to modal from. The error occurs whenever I call $scope.modal.hide(); or $;

Anyone any idea why this is coming up?

Do you mind creating a codepen with this issue?

I’ll try and get back to you.

Here you go

You have ui-sref="add-trip" on the buttons inside the modal. There is no state with that name, so just remove this attribute or create a new state with the name add-trip.


I’m an idiot. Thanks.

Not an idiot. I call it code blindness. When you stare at a problem so long you no longer see it clearly. Happens to all of us!

1 Like

The annoying thing was I search for “add” in all my code but Sublime Text didn’t find it!