【发布时间】:2020-11-09 08:57:20
【问题描述】:
这行得通:
'use strict';
angular.module('MyApp').service('searchControllerPersistentData', ['$state', function ($state)
{
const Self = this;
}]);
但这会在我尝试注入服务的控制器中出现错误:
'use strict';
angular.module('MyApp').service('searchControllerPersistentData', ['', function ()
{
const Self = this;
}]);
服务不需要注入任何东西。如何申报?
【问题讨论】:
标签: angularjs angularjs-service