Skip to content

Commit ca2a5e8

Browse files
committed
Fix issues with ng-repeat example in demo page
1 parent f685009 commit ca2a5e8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

demo/demo-controller.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ angular.module('demo.demoController', [])
4545
};
4646

4747

48-
$scope.guardianOnTimeSet = function ($index) {
48+
$scope.guardianOnSetTime = function ($index, guardian, newDate, oldDate) {
4949
console.log($index);
50-
$('#guardian' + $index).dropdown('toggle');
50+
console.log(guardian.name);
51+
console.log(newDate);
52+
console.log(oldDate);
53+
angular.element('#guardian' + $index).dropdown('toggle');
5154
};
5255

5356
$scope.beforeRender = function ($dates) {
@@ -56,4 +59,4 @@ angular.module('demo.demoController', [])
5659
$dates[index].selectable = false;
5760
};
5861
}
59-
]);
62+
]);

demo/index.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ <h3>Embedded calendar form integration</h3>
260260

261261
<div class="row">
262262
<div class="col-sm-6">
263-
263+
<h3>ng-repeat with drop-down using text link</h3>
264+
<p><code>data-on-set-time="guardianOnSetTime($index, guardian, newDate, oldDate)"</code></p>
264265
<div class="well" data-ng-repeat = "guardian in data.guardians">
265266
<p>{{ guardian.name }}</p>
266267
<p>DOB: {{ guardian.dob | date:'yyyy-MM-dd' }} </p>
@@ -271,7 +272,7 @@ <h3>Embedded calendar form integration</h3>
271272
</a>
272273
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
273274
<datetimepicker data-ng-model="guardian.dob"
274-
data-on-set-time="guardianOnTimeSetDoesNotExist"></datetimepicker>
275+
data-on-set-time="guardianOnSetTime($index, guardian, newDate, oldDate)"></datetimepicker>
275276
</ul>
276277
</div>
277278
</div>
@@ -309,4 +310,4 @@ <h4>One date is randomly disabled on each view</h4>
309310

310311

311312
</body>
312-
</html>
313+
</html>

0 commit comments

Comments
 (0)