Skip to content

Commit abb8e93

Browse files
committed
Adding visibility to the ActivityIndicator
1 parent 4a58ac0 commit abb8e93

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ <h4 class="exercise-start">
15401540
</h4>
15411541

15421542
<p>Open up <code>app/pages/list/list.html</code> and paste the following line immediately before the final <code>&lt;/GridLayout&gt;</code>:</p>
1543-
<pre><code class="lang-XML">&lt;ActivityIndicator [busy]=&quot;isLoading&quot; row=&quot;1&quot; horizontalAlignment=&quot;center&quot; verticalAlignment=&quot;center&quot;&gt;&lt;/ActivityIndicator&gt;
1543+
<pre><code class="lang-XML">&lt;ActivityIndicator [busy]=&quot;isLoading&quot; [visibility]=&quot;isLoading ? &#39;visible&#39; : &#39;collapse&#39;&quot; row=&quot;1&quot; horizontalAlignment=&quot;center&quot; verticalAlignment=&quot;center&quot;&gt;&lt;/ActivityIndicator&gt;
15441544
</code></pre>
15451545
<p>This binds the ActivityIndicator’s <code>busy</code> attribute to an <code>isLoading</code> property in the <code>ListPage</code> component. To define that property, open <code>app/pages/list/list.component.ts</code> and add the following line of code immediately under <code>grocery: string = &quot;&quot;</code>:</p>
15461546
<pre><code class="lang-TypeScript">isLoading = false;

src/chapters/chapter4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ In NativeScript apps you can use the [ActivityIndicator](http://docs.nativescrip
591591
Open up `app/pages/list/list.html` and paste the following line immediately before the final `</GridLayout>`:
592592

593593
``` XML
594-
<ActivityIndicator [busy]="isLoading" row="1" horizontalAlignment="center" verticalAlignment="center"></ActivityIndicator>
594+
<ActivityIndicator [busy]="isLoading" [visibility]="isLoading ? 'visible' : 'collapse'" row="1" horizontalAlignment="center" verticalAlignment="center"></ActivityIndicator>
595595
```
596596

597597
This binds the ActivityIndicators `busy` attribute to an `isLoading` property in the `ListPage` component. To define that property, open `app/pages/list/list.component.ts` and add the following line of code immediately under `grocery: string = ""`:

0 commit comments

Comments
 (0)