尝试读取protobuf对象而不是Angular4中的JSON对象。
我找到了这个dcodeIO/protobufjs 。但我不明白我应该如何在我的项目中使用它?
我还尝试使用 Typings install dt~protobufjs --global 安装 protobufjs 的类型。当我导入它时,WebStorm 说找不到模块 protobuf。
任何帮助!赞赏!
最佳答案
我们可以使用 google-protobuf 库读取 angular4 中的 protobuf 对象。 导入语法是 -
## import * as goog from 'google-protobuf'; ##
引用 github 链接是 - https://github.com/sparten11740/angular-protobuf-example
关于javascript - 如何读取 angular4 中响应 HTTP 请求而收到的 protobuf 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48108904/