@@ -300,8 +300,13 @@ angular.module('schemaForm').controller('dynamicSelectController', ['$scope', '$
300
300
console . log ( 'asyncCallback items' , form . titleMap ) ;
301
301
} ,
302
302
function ( data , status ) {
303
- alert ( "Loading select items failed(Options: '" + String ( form . options ) +
304
- "\nError: " + status ) ;
303
+ if ( form . options . onPopulationError ) {
304
+ $scope . getCallback ( form . options . onPopulationError ) ( form , data , status ) ;
305
+ }
306
+ else {
307
+ alert ( "Loading select items failed(Options: '" + String ( form . options ) +
308
+ "\nError: " + status ) ;
309
+ }
305
310
} ) ;
306
311
}
307
312
else if ( form . options . httpPost ) {
@@ -314,8 +319,13 @@ angular.module('schemaForm').controller('dynamicSelectController', ['$scope', '$
314
319
console . log ( 'httpPost items' , form . titleMap ) ;
315
320
} ,
316
321
function ( data , status ) {
317
- alert ( "Loading select items failed (URL: '" + String ( finalOptions . httpPost . url ) +
318
- "' Parameter: " + String ( finalOptions . httpPost . parameter ) + "\nError: " + status ) ;
322
+ if ( form . options . onPopulationError ) {
323
+ $scope . getCallback ( form . options . onPopulationError ) ( form , data , status ) ;
324
+ }
325
+ else {
326
+ alert ( "Loading select items failed (URL: '" + String ( finalOptions . httpPost . url ) +
327
+ "' Parameter: " + String ( finalOptions . httpPost . parameter ) + "\nError: " + status ) ;
328
+ }
319
329
} ) ;
320
330
}
321
331
else if ( form . options . httpGet ) {
@@ -326,8 +336,13 @@ angular.module('schemaForm').controller('dynamicSelectController', ['$scope', '$
326
336
console . log ( 'httpGet items' , form . titleMap ) ;
327
337
} ,
328
338
function ( data , status ) {
329
- alert ( "Loading select items failed (URL: '" + String ( finalOptions . httpGet . url ) +
330
- "\nError: " + status ) ;
339
+ if ( form . options . onPopulationError ) {
340
+ $scope . getCallback ( form . options . onPopulationError ) ( form , data , status ) ;
341
+ }
342
+ else {
343
+ alert ( "Loading select items failed (URL: '" + String ( finalOptions . httpGet . url ) +
344
+ "\nError: " + status ) ;
345
+ }
331
346
} ) ;
332
347
}
333
348
else {
0 commit comments