0

This works:

'use strict';

angular.module('MyApp').service('searchControllerPersistentData', ['$state', function ($state) 
{
    const Self = this;
}]);

but this gives an error in the controller where I try to inject the service:

'use strict';

angular.module('MyApp').service('searchControllerPersistentData', ['', function () 
{
    const Self = this;
}]);

The service will not need anything injected into it. How do I declare it?

1 Answer 1

1

Just remove the brackets :

angular.module('MyApp').service('searchControllerPersistentData', function () 
{
    const Self = this;
});

Sign up to request clarification or add additional context in comments.

1 Comment

D'oh! :-) Thanks for that

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.