【问题标题】:How to read protobuf object in angular4 received in response of an HTTP request如何读取响应 HTTP 请求而收到的 angular4 中的 protobuf 对象
【发布时间】:2018-01-05 07:17:15
【问题描述】:

尝试在 angular4 中读取 protobuf 对象而不是 JSON 对象。

我找到了这个dcodeIO/protobufjs。但我不明白我应该如何在我的项目中使用它?

我还尝试使用 typings install dt~protobufjs --global 为 protobufjs 安装类型。当我导入它时,WebStorm 说找不到模块 protobuf。

任何帮助!赞赏!

【问题讨论】:

    标签: javascript arrays angular arraybuffer protobuf.js


    【解决方案1】:

    我们可以使用 google-protobuf 库读取 angular4 中的 protobuf 对象。 导入语法是 -

    ## import * as goog from 'google-protobuf'; ##
    

    参考 github 链接是 - https://github.com/sparten11740/angular-protobuf-example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-13
      • 2020-09-24
      • 1970-01-01
      相关资源
      最近更新 更多