尝试在 angular4 中读取 protobuf 对象而不是 JSON 对象。
我找到了这个dcodeIO/protobufjs。但我不明白我应该如何在我的项目中使用它?
我还尝试使用 typings install dt~protobufjs --global 为 protobufjs 安装类型。当我导入它时,WebStorm 说找不到模块 protobuf。
任何帮助!赞赏!
尝试在 angular4 中读取 protobuf 对象而不是 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