【发布时间】:2017-07-19 12:42:50
【问题描述】:
我想为现有项目实现 openweathermaps api,但在添加一些依赖项时遇到问题。
当前项目正在使用 ES6(我认为它是 Angular 的 1.5.x 版本)并且我已经通过 bower angular-openweathermap-api-factory 模块安装。
我收到此错误:ReferenceError: openweathermapFactory is not defined 我猜它与“将 jtt_openweathermap 添加到应用程序的模块依赖项”有关。因为我不确定如何将它添加到 ES6 项目中。
有什么帮助吗?
【问题讨论】:
-
您能分享您的故障代码的代码 sn-p 和完整的错误消息吗?
-
实际上,我的答案见下文。
-
我使用了 http 请求并从 json 中提取数据。现在可以了。如果我有时间,我会尝试使用模块来实现它并在此处发布答案。
标签: javascript angularjs ecmascript-6