Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps for adding st-safe-src #52

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sections/basics/markup.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ <h3 class="h3">stSafeSrc attribute</h3>

<p class="text-justify">Use it to tell smart-table which collection to watch if you intend to modify its content. Don't pay attention to the sort and filter directives for the moment but use the table and note how the data is correctly synced</p>

<p class="text-justify">If you are starting with the basic table above, change <code>st-table="rowCollection"</code> to a new name (eg. <code>st-table="displayedCollection"</code>) and add your original table dataset to <code>st-safe-src="rowCollection"</code>. Change your repeating table data to <code>ng-repeat="displayedCollection"</code>.</p>
<tabset>
<tab heading="Markup">
<pre ng-non-bindable><code class="language-markup"> &lt;div ng-controller="safeCtrl">
Expand All @@ -100,7 +101,7 @@ <h3 class="h3">stSafeSrc attribute</h3>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr ng-repeat="row in displayedCollection">
&lt;tr ng-repeat="row in displayedCollection"> &lt;!-- ensure collection matches st-table name -->
&lt;td>{{row.firstName}}&lt;/td>
&lt;td>{{row.lastName}}&lt;/td>
&lt;td>{{row.birthDate}}&lt;/td>
Expand Down