service<Id, Data> method
Service<Id, Data>
service<Id, Data>(
- String path, {
- Type? type,
- AngelDeserializer<
Data> ? deserializer,
override
Creates a Service instance that queries a given path on the server.
This expects that there is an Angel Service
mounted on the server.
In other words, all endpoints will return Data
, except for the root of
path
, which returns a List<Data>.
You can pass a custom deserializer
, which is typically necessary in cases where
dart:mirrors
does not exist.
Implementation
@override
Service<Id, Data> service<Id, Data>(String path,
{Type? type, AngelDeserializer<Data>? deserializer}) {
var url = baseUrl.replace(path: _p.join(baseUrl.path, path));
var s = BaseAngelService<Id, Data>(client, this, url,
deserializer: deserializer);
_services.add(s);
return s as Service<Id, Data>;
}