Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这可能超出了 AngularJS 的范围和能力,但我希望将它放在那里。是否可以在 AngularJS 中每 30 秒读取一次 RSS 提要,并将类别 id 为“X”的最新 10 个结果绑定到模型或数据集合?
长话短说,是的。
您可以创建一个service用于拉取 RSS 的模块,并可以在 中调用该服务controller,或对其进行调度。Angularjs 是 2-way binding,只要在 scope 内更新数据,就会自动渲染到模板中。
service
controller