@@ -41,11 +41,21 @@ <h1>Schema Form Example</h1>
4141 < div class ="col-md-4 "> < p ng-if ="error " class ="alert alert-danger "> {{error}}</ p > </ div >
4242 </ div >
4343 < div class ="row ">
44- < div class ="col-sm-4 ">
45- < button ng-click ="save(); "> Save</ button >
46- < br >
47- < p > {{link}}</ p >
44+ < div class ="col-sm-4 ">
45+ < button ng-click ="save(); "> Save</ button >
46+ </ div >
47+ </ div >
48+ < br >
49+ < div class ="row ">
50+ < div class ="col-md-2 ">
51+ < div class ="input-group ">
52+ < input type ="text " class ="form-control " aria-label ="Amount (to the nearest dollar) ">
53+ < span class ="input-group-btn ">
54+ < button class ="btn btn-default copy " type ="button "> < span class ="glyphicon glyphicon-copy " aria-hidden ="true "> </ span > </ button >
55+ </ span >
4856 </ div >
57+
58+ </ div >
4959 </ div >
5060 < div class ="row ">
5161 < div class ="col-sm-4 ">
@@ -134,10 +144,9 @@ <h3>Schema</h3>
134144 $scope . loading = true ;
135145 $http . get ( 'https://api.github.com/gists/' + gistId ) . success ( function ( res ) {
136146 $scope . loading = false ;
137- //var data = JSON.parse(res.files['schemaform.json'].content);
138147 $scope . schemaJson = res . files [ 'schema.json' ] . content ;
139148 $scope . formJson = res . files [ 'form.json' ] . content ;
140- $scope . modelData = res . files [ 'model.json' ] . content ; // Knasig
149+ $scope . modelData = res . files [ 'model.json' ] . content ;
141150 } ) . error ( function ( res ) {
142151 $scope . error = 'Failed to load gist.' ;
143152 } ) ;
@@ -188,7 +197,7 @@ <h3>Schema</h3>
188197 } ;
189198
190199 $scope . pretty = function ( ) {
191- return JSON . stringify ( $scope . modelData , undefined , 2 , 2 ) ;
200+ return typeof $scope . modelData === 'string' ? $scope . modelData : JSON . stringify ( $scope . modelData , undefined , 2 ) ;
192201 } ;
193202
194203 $scope . log = function ( msg ) {
0 commit comments