Update 02_build_a_dashboard.rst
fix rpc service use from useService to import
This commit is contained in:
parent
4b6e34efc5
commit
b46e547a93
@ -205,10 +205,11 @@ A basic request could look like this:
|
|||||||
|
|
||||||
.. code-block:: js
|
.. code-block:: js
|
||||||
|
|
||||||
|
import { rpc } from "@web/core/network/rpc";
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
this.rpc = useService("rpc");
|
|
||||||
onWillStart(async () => {
|
onWillStart(async () => {
|
||||||
const result = await this.rpc("/my/controller", {a: 1, b: 2});
|
const result = await rpc("/my/controller", {a: 1, b: 2});
|
||||||
// ...
|
// ...
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user