Skip to content

Commit fbc9ba7

Browse files
committed
Attempting to improve documentation + Correct promise reloading
1 parent 56cfa74 commit fbc9ba7

22 files changed

+739
-144
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ See [github page](https://l-lin.github.io/angular-datatables).
6767
Additional notes
6868
----------------
6969

70-
Each time a datatable is rendered, a message is sent to the parent scopes with the id of the table.
70+
* This module does not support multiple datatables in the same page (YET)! You can do it, but expect some side effects!
71+
* Each time a datatable is rendered, a message is sent to the parent scopes with the id of the table.
7172

7273
For instance, for the given dataTable:
7374

demo/dataReloadWithPromise.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
$scope.dtOptions.reloadData();
1010
};
1111
$scope.changeData = function() {
12-
$scope.dtOptions.fnPromise = $resource('data1.json').query().$promise;
12+
$scope.dtOptions.fnPromise = function() {
13+
return $resource('data1.json').query().$promise;
14+
};
15+
// Or $scope.dtOptions.fnPromise = $resource('data1.json').query().$promise;
1316
};
1417

1518
$scope.dtOptions = DTOptionsBuilder.fromFnPromise(function() {

demo/partials/angular_way.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ <h1><i class="fa fa-play"></i>&nbsp;The Angular way</h1>
55
<section class="article-content">
66
<p>
77
You can construct your table the "angular" way, eg using the directive <code>ng-repeat</code> on <code>tr</code> tag.
8-
All you need to do is to add the directive <code>datatable</code> and <code>dt-rows</code> on your table in order
8+
All you need to do is to add the directive <code>datatable</code> with the value <code>ng</code> and <code>dt-rows</code> on your table in order
99
to make it rendered with DataTables.
1010
</p>
1111
</section>
@@ -14,7 +14,7 @@ <h1><i class="fa fa-play"></i>&nbsp;The Angular way</h1>
1414
<tab heading="Preview">
1515
<article class="preview">
1616
<div ng-controller="angularWayCtrl">
17-
<table datatable="ng">
17+
<table datatable="ng" class="row-border hover">
1818
<thead>
1919
<tr>
2020
<th>ID</th>
@@ -36,7 +36,7 @@ <h1><i class="fa fa-play"></i>&nbsp;The Angular way</h1>
3636
<tab heading="HTML">
3737
<div hljs>
3838
<div ng-controller="angularWayCtrl">
39-
<table datatable="ng">
39+
<table datatable="ng" class="row-border hover">
4040
<thead>
4141
<tr>
4242
<th>ID</th>

demo/partials/angular_way_with_options.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ <h1><i class="fa fa-play"></i>&nbsp;The Angular way with options</h1>
55
<section class="article-content">
66
<p>
77
You can also provide datatable options and datatable column options with the directive
8-
<code>dt-options</code> and <code>dt-columns</code>:
8+
<code>dt-options</code>:
99
</p>
1010
</section>
1111
<section class="showcase">
1212
<tabset>
1313
<tab heading="Preview">
1414
<article class="preview">
1515
<div ng-controller="angularWayWithOptionsCtrl">
16-
<table datatable="ng" dt-options="dtOptions" dt-columns="dtColumns">
16+
<table datatable="ng" dt-options="dtOptions" dt-columns="dtColumns" class="row-border hover">
1717
<thead>
1818
<tr>
1919
<th>ID</th>
@@ -35,7 +35,7 @@ <h1><i class="fa fa-play"></i>&nbsp;The Angular way with options</h1>
3535
<tab heading="HTML">
3636
<div hljs>
3737
<div ng-controller="angularWayWithOptionsCtrl">
38-
<table datatable="ng" dt-options="dtOptions" dt-columns="dtColumns">
38+
<table datatable="ng" dt-options="dtOptions" dt-columns="dtColumns" class="row-border hover">
3939
<thead>
4040
<tr>
4141
<th>ID</th>

0 commit comments

Comments
 (0)