Is it possible to directly display the data in the service on the page without using $scope as an intermediate variable?
过去多啦不再A梦2017-05-15 17:03:27
No, it’s not recommended either.
This breaks the layering of MVC.
But in theory you can write a directive implementation specifically for this
为情所困2017-05-15 17:03:27
Page display needs to be controlled by the controller, so the data must pass through the controller and then be presented to the page. On the contrary, you can omit the service, inject $http and $q directly into the controller, and move the service code to the controller. But this function is feasible, but the actual code structure is messed up. So this is not recommended. As for not having a controller, it’s not feasible.