$state.go() not working. App structure [Solved]

Hey Guys,
Yesterday I divided my JS app file into app, controllers and services. I also separate each template into different html files and save them in a folder call views. Everything worked fine except for my app’s authentication system. My app check if users information stored in localstorage so to redirect him to the main view. I use $state.go and before this there were no problems but now is not working and is NOT EVEN displaying an error in the console. Please help me! Here there are some images of my file structure and code.

Thanks you all very much

index.html:
image
controller.js:
image
app.js:

As you can see I linked the “appCtrl” to index.html body. Until I restructure my project It worked fine but now It does not.

Thanks again!

Hi @obesio,

Try moving the ui.router dependency to your main module(cobranzas). Let me know if that works.

PS: i’m not sure, but i don’t think you still need to add ionic as a dependency for your controllers module since it’s already available on your main module declaration.

I was finally able to solve it. This is what I changed:

Now I run that function on $ionicView.enter and works fine. Not sure why but it does haha.

I hope this helps!