File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -151,12 +151,12 @@ def Hello(greeting_recipient): # component names are camelcase by convention
151
151
## ` example_app/templates/your-template.html `
152
152
153
153
In your templates, you may inject a view of an IDOM component into your templated HTML
154
- by using the ` idom_view ` template tag. This tag which requires the name of a component
154
+ by using the ` idom_component ` template tag. This tag which requires the name of a component
155
155
to render (of the form ` module_name.ComponentName ` ) and keyword arguments you'd like to
156
156
pass it from the template.
157
157
158
158
``` python
159
- idom_view module_name.ComponentName param_1= " something" param_2= " something-else"
159
+ idom_component module_name.ComponentName param_1= " something" param_2= " something-else"
160
160
```
161
161
162
162
In context this will look a bit like the following...
@@ -170,7 +170,7 @@ In context this will look a bit like the following...
170
170
<html>
171
171
<body>
172
172
...
173
- {% idom_view "your_app.example_app.components.Hello" greeting_recipient="World" %}
173
+ {% idom_component "your_app.example_app.components.Hello" greeting_recipient="World" %}
174
174
</body>
175
175
</html>
176
176
```
Original file line number Diff line number Diff line change 7
7
mountPoint ,
8
8
"{{ idom_websocket_url }}" ,
9
9
"{{ idom_web_modules_url }}" ,
10
- "{{ idom_view_id }}" ,
11
- "{{ idom_view_params }}"
10
+ "{{ idom_component_id }}" ,
11
+ "{{ idom_component_params }}"
12
12
) ;
13
13
</ script >
Original file line number Diff line number Diff line change 17
17
18
18
19
19
@register .inclusion_tag ("idom/view.html" )
20
- def idom_view (_component_id_ , ** kwargs ):
20
+ def idom_component (_component_id_ , ** kwargs ):
21
21
_register_component (_component_id_ )
22
22
23
23
json_kwargs = json .dumps (kwargs , separators = ("," , ":" ))
@@ -26,8 +26,8 @@ def idom_view(_component_id_, **kwargs):
26
26
"idom_websocket_url" : IDOM_WEBSOCKET_URL ,
27
27
"idom_web_modules_url" : IDOM_WEB_MODULES_URL ,
28
28
"idom_mount_uuid" : uuid4 ().hex ,
29
- "idom_view_id " : _component_id_ ,
30
- "idom_view_params " : urlencode ({"kwargs" : json_kwargs }),
29
+ "idom_component_id " : _component_id_ ,
30
+ "idom_component_params " : urlencode ({"kwargs" : json_kwargs }),
31
31
}
32
32
33
33
Original file line number Diff line number Diff line change 15
15
16
16
< body >
17
17
< h1 > IDOM Test Page</ h1 >
18
- < div > {% idom_view "test_app.components.HelloWorld" %}</ div >
19
- < div > {% idom_view "test_app.components.Button" %}</ div >
18
+ < div > {% idom_component "test_app.components.HelloWorld" %}</ div >
19
+ < div > {% idom_component "test_app.components.Button" %}</ div >
20
20
< div >
21
- {% idom_view "test_app.components.ParametrizedComponent" x=123 y=456 %}
21
+ {% idom_component "test_app.components.ParametrizedComponent" x=123 y=456
22
+ %}
22
23
</ div >
23
- < div > {% idom_view "test_app.components.SimpleBarChart" %}</ div >
24
+ < div > {% idom_component "test_app.components.SimpleBarChart" %}</ div >
24
25
</ body >
25
26
</ html >
You can’t perform that action at this time.
0 commit comments