Skip to content Skip to sidebar Skip to footer

Referenceerror: $state Is Not Defined

I have a rails application which use AngularJS and I have a problem, the problem is that I want redirect to a certain state after a form is submited, but in the chrome's console I

Solution 1:

you forgot add $state to function()

angular.module('myapp')

.controller('CreatePollCtrl', ['$scope', 'Restangular', '$state',
function($scope, Restangular, $state) {

Solution 2:

Add $state as a parameter to your function, like $scope.addPoll = function($state) {...}

Post a Comment for "Referenceerror: $state Is Not Defined"