【问题标题】:Angular2 - how should I parse xml into json?Angular2 - 我应该如何将 xml 解析为 json?
【发布时间】:2016-01-21 01:48:40
【问题描述】:

我想导入 RSS,但我不知道如何使用 angular2/typescript 将 xml 解析为 json。我已经看到很多使用 jquery 的方法来做到这一点,但我需要批准这是最好的方法。

你能告诉我我应该使用什么吗?谢谢。

【问题讨论】:

    标签: json xml parsing angular


    【解决方案1】:

    我看到很多人使用 google feed api 来检索 json 格式的 RSS Feed。

    我在 Google 上找到了一个小提琴:

    http://jsfiddle.net/mahbub/b8Wcz/

    这是他调用 Google API 的方式: $http.jsonp('//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=50&callback=JSON_CALLBACK&q=' + encodeURIComponent(url));

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-27
      • 1970-01-01
      • 2011-10-08
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 2017-08-17
      相关资源
      最近更新 更多