search

Home  >  Q&A  >  body text

angular.js - How to define such a getter in the controller

The purpose is to get an attribute on the scope. However, this attribute is fetched asynchronously in the service and then synchronized to the scope. If I add this getter method to html, why will it be executed multiple times?~

仅有的幸福仅有的幸福2879 days ago778

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-15 17:14:09

    Run the getter method in the callback after the request is completed, and put it after the data is synchronized to the scope

    reply
    0
  • Cancelreply