利用AngularJS框架实践各种设计模式:AngularJS in Patterns。
利用AngularJS框架实践各种设计模式:AngularJS in Patterns。
Proxy
A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate.
We can distinguish three different types of proxy:
- Virtual Proxy
- Remote Proxy
- Protection Proxy
In this sub-chapter we are going to take a look at AngularJS' implementation of Virtual Proxy.
In the snippet bellow, there is a call to the get
method of $resource
instance, called User
:
var User = $resource('/users/:id'), user = User.get({ id: 42 }); console.log(user); //{}
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!