@@ -45,7 +45,7 @@ A real-time product search component might look like this::
4545 <input
4646 type="search"
4747 name="query"
48- value="{{ this. query }}"
48+ value="{{ query }}"
4949 data-action="live#update"
5050 >
5151
@@ -247,19 +247,19 @@ Let's add two inputs to our template:
247247 <div {{ init_live_component(this) }}>
248248 <input
249249 type="number"
250- value="{{ this. min }}"
250+ value="{{ min }}"
251251 data-model="min"
252252 data-action="live#update"
253253 >
254254
255255 <input
256256 type="number"
257- value="{{ this. max }}"
257+ value="{{ max }}"
258258 data-model="max"
259259 data-action="live#update"
260260 >
261261
262- Generating a number between {{ this. min }} and {{ this. max }}
262+ Generating a number between {{ min }} and {{ max }}
263263 <strong>{{ this.randomNumber }}</strong>
264264 </div>
265265
@@ -316,7 +316,7 @@ happens, add it to the ``data-action`` call:
316316
317317 <input
318318 type="number"
319- value="{{ this. max }}"
319+ value="{{ max }}"
320320 data-model="max"
321321 - data-action="live#update"
322322 + data-action="change->live#update"
@@ -341,7 +341,7 @@ clicked). To do that, use the ``updateDefer`` method:
341341
342342 <input
343343 type="number"
344- value="{{ this. max }}"
344+ value="{{ max }}"
345345 data-model="max"
346346 - data-action="live#update"
347347 + data-action="live#updateDefer"
@@ -364,7 +364,7 @@ property. The following code works identically to the previous example:
364364 <div {{ init_live_component(this)>
365365 <input
366366 type="number"
367- value="{{ this. min }}"
367+ value="{{ min }}"
368368 - data-model="min"
369369 + name="min"
370370 data-action="live#update"
@@ -1016,19 +1016,19 @@ rendered the ``content`` through a Markdown filter from the
10161016 <div {{init_live_component(this)}}>
10171017 <input
10181018 type="text"
1019- value="{{ this. post.title }}"
1019+ value="{{ post.title }}"
10201020 data-model="post.title"
10211021 data-action="live#update"
10221022 >
10231023
10241024 <textarea
10251025 data-model="post.content"
10261026 data-action="live#update"
1027- >{{this. post.content}}</textarea>
1027+ >{{post.content}}</textarea>
10281028
10291029 <div className="markdown-preview" data-loading="addClass(low-opacity)">
1030- <h3>{{this. post.title}}</h3>
1031- {{this. post.content | markdown_to_html}}
1030+ <h3>{{post.title}}</h3>
1031+ {{post.content | markdown_to_html}}
10321032 </div>
10331033 </div>
10341034
@@ -1142,7 +1142,7 @@ method:
11421142 data-model="post.content"
11431143 data-action="live#update"
11441144 class="{{ this.getError('post.content') ? 'has-error' : '' }}"
1145- >{{ this. post.content }}</textarea>
1145+ >{{ post.content }}</textarea>
11461146
11471147 Once a component has been validated, the component will “rememeber” that
11481148it has been validated. This means that, if you edit a field and the
@@ -1162,7 +1162,7 @@ blur the field), update the model via the ``change`` event:
11621162 data-model="post.content"
11631163 data-action="change->live#update"
11641164 class="{{ this.getError('post.content') ? 'has-error' : '' }}"
1165- >{{ this. post.content }}</textarea>
1165+ >{{ post.content }}</textarea>
11661166
11671167 When the component re-renders, it will signal to the server that this
11681168one field should be validated. Like with normal validation, once an
@@ -1399,13 +1399,13 @@ In the ``EditPostComponent`` template, you render the
13991399 type="text"
14001400 name="post[title]"
14011401 data-action="live#update"
1402- value="{{ this. post.title }}"
1402+ value="{{ post.title }}"
14031403 >
14041404
14051405 {{ component('markdown_textarea', {
14061406 name: 'post[content]',
14071407 label: 'Content',
1408- value: this. post.content
1408+ value: post.content
14091409 }) }}
14101410
14111411 <button
@@ -1418,13 +1418,13 @@ In the ``EditPostComponent`` template, you render the
14181418
14191419 <div {{ init_live_component(this) }} class="mb-3">
14201420 <textarea
1421- name="{{ this. name }}"
1421+ name="{{ name }}"
14221422 data-model="value"
14231423 data-action="live#update"
1424- >{{ this. value }}</textarea>
1424+ >{{ value }}</textarea>
14251425
14261426 <div class="markdown-preview">
1427- {{ this. value|markdown_to_html }}
1427+ {{ value|markdown_to_html }}
14281428 </div>
14291429 </div>
14301430
0 commit comments