What are “decorators” and how are they used?

前端 未结 5 1858
抹茶落季
抹茶落季 2020-11-28 01:07

I\'m curious what exactly decorators are in AngularJS. There isn\'t much information online for decorators save for a blurb in the AngularJS documentation and a brief (albei

5条回答
  •  猫巷女王i
    2020-11-28 01:42

    decorator can intercept service instance created by factory, service, value, provider, and gives the options to change some instance(service) that is otherwise not configurable / with options.

    It can also provide mock up instances for testing purpose, for example $http.

提交回复
热议问题