在require.config路径中调用服务

时间:2018-06-05 08:44:54

标签: angularjs service requirejs require referenceerror

是否有可能从服务中获取您的路径?因为我有以下错误:

cause: ReferenceError: serviceFactory is not defined

这是我尝试做的事情:

require.config
          paths:
            vScript:
              do ->
                service = serviceFactory.getService()
                if !service
                  throw new Error 'not configured.'
                url = service.getScriptUrl()
                return url = 'https://test.com/js/test.1.min'
          shim:
            vScript:
              exports: 'v'

        require ['vScript'], ->
          _alreadyLoaded = true

0 个答案:

没有答案