74
在下面的示例测试中,原始提供程序名称是APIEndpointProvider,但对于注入和服务实例化来说,约定似乎是必须使用包装它的下划线注入。这是为什么?AngularJS测试中_servicename_中的下划线是什么意思?
'use strict';
describe('Provider: APIEndpointProvider', function() {
beforeEach(module('myApp.providers'));
var APIEndpointProvider;
beforeEach(inject(function(_APIEndpointProvider_) {
APIEndpointProvider = _APIEndpointProvider_;
}));
it('should do something', function() {
expect(!!APIEndpointProvider).toBe(true);
});
});
什么是约定我错过了更好的解释?