Skip to content

Injecting $state into a service does not seem to work (resolves, but no functionality) #403

@scribblet

Description

@scribblet

Hi,

I have written a factory service that has $state injected.

  angular.module('authService', ['taprApi', 'ui.router']).factory('authService', function($document, $state, taprApi) {
      var authService = {
      ....
      };
      return authService;
    }

The problem is whenever I call $state.go() inside a function attached to a property on authService, nothing happens. What is the logical solution here?

I realise the problem may be with my approach (perhaps services should never be able to transition to another state, and this is by design) and not with the library. I am unsure of where to ask for help/clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions