$state.go not working on device



My appli working on chrome but not when i try on ionic platform, on android. I use $state.go when i use the search bar then, i swtich to a view result.

My controller :

.controller('ResultCtrl', ['$scope', '$http', '$state', '$location',
  function($scope, $http, $state, $location) {
    $scope.$watch("query.length", function(val) {
		if (val > 0) {
		if (val == 0) {
		$scope.init = function() {
				url: 'http://melanie-croce.fr/projets/app-back/public/api/v1/videos',
				method: "GET",
				}).success(function(videos) {
					$scope.videos = videos;

I did a search bar, when I do my research, it changes my view for the search results. it works fine on browser but on device, the result page does not display at all when I write. I’m doing research, but no solution … is the probleme that I use $state.go in a controller? I do not know and I hope that’s not the problem …



This looks like ionic 1. You might wanna change the category of the topic to ionic 1 :slight_smile: Also ‘not working’ is quite a wide statement to use. More details will likely get you more/better answers.

  • What are you trying to do?
  • What are the steps to reproduce the problem?
  • What have you tried yourself.

And please align/indent your code properly, its hard to read if you dont show it properly.


Sorry, i’m a newbie, i edit my post, thanks !


Solved! Stupid mistake in my router, I have “templateURL 'templates / result.html” instead of" templateURL ‘Templates / restult.html’"