From 60917bb1028ec39922d82602db2016ca275a38a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Sat, 15 Jun 2019 10:38:29 +0200 Subject: [PATCH] [DOC] improve main readme.md --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0ec68bc4..771d7f02 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,16 @@ find some more information [here](doc/comparison.md). Here is a short example to illustrate interactive widgets: +```xml + + + +``` + ```javascript -class ClickCounter extends owl.Component { +class Counter extends owl.Component { state = { value: 0 }; increment() { @@ -43,17 +51,14 @@ class ClickCounter extends owl.Component { } } -const TEMPLATES = ` - `; - const qweb = new owl.QWeb(TEMPLATES); -const counter = new ClickCounter({ qweb }); +const counter = new Counter({ qweb }); counter.mount(document.body); ``` -More interesting examples can be found on the [playground](https://odoo.github.io/owl/playground) application. +Note that we assume here that the xml templates are available in the `TEMPLATES` +string. More interesting examples can be found on the +[playground](https://odoo.github.io/owl/playground) application. ## Installing/Building