Skip to content

Commit 23ea369

Browse files
committed
Added gist to select box in examples when one is loaded
1 parent adfc4ea commit 23ea369

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/bootstrap-example.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ <h3>Schema</h3>
262262
$scope.loading = true;
263263
$http.get('https://api.github.com/gists/' + gistId).success(function(res) {
264264
$scope.error = null;
265+
$scope.tests.unshift({name: 'Gist'});
266+
$scope.selectedTest = $scope.tests[0];
265267
$scope.loadedData = {
266268
created: moment(res.created_at).fromNow(),
267269
user: res.user !== null ? res.user.login : 'Anonymous'
@@ -279,7 +281,7 @@ <h3>Schema</h3>
279281
$scope.selectedTest = $scope.tests[0];
280282

281283
$scope.$watch('selectedTest',function(val){
282-
if (val) {
284+
if (val && val.data !== undefined) {
283285
$http.get(val.data).then(function(res) {setNewData(res.data);});
284286
}
285287
});

0 commit comments

Comments
 (0)