简体   繁体   English

矩形如何建立自定义网址

[英]Restangular how to build custom url

with this code 用这个代码

RestangularProvider.setBaseUrl('http://localhost:8080/api/1');
var elements = Restangular.all('events');
elements.getList();

I can call the endpoint 我可以叫终点

http://localhost:8080/api/1/events HTTP://本地主机:8080 / API / 1 /事件

but how can manage the code to have 但是如何管理代码

http://localhost:8080/api/1/events/around/me HTTP://本地主机:8080 / API / 1 /事件/左右/箱

您可以使用以下代码来获取事件

var getEvents = Restangular.oneUrl('getEventAroundMe', 'http://localhost:8080/api/1/events/around/me');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM