11/*!
22 * angular-schema-form
3- * @version 1.0.0-alpha.3
4- * @date Sun, 02 Apr 2017 13:11:29 GMT
3+ * @version 1.0.0-alpha.4
4+ * @date Mon, 03 Apr 2017 12:57:49 GMT
55 * @link https://github.com/json-schema-form/angular-schema-form
66 * @license MIT
77 * Copyright (c) 2014-2017 JSON Schema Form
7171/******/ __webpack_require__ . p = "" ;
7272/******/
7373/******/ // Load entry module and return exports
74- /******/ return __webpack_require__ ( __webpack_require__ . s = 21 ) ;
74+ /******/ return __webpack_require__ ( __webpack_require__ . s = 19 ) ;
7575/******/ } )
7676/************************************************************************/
7777/******/ ( [
@@ -2729,7 +2729,7 @@ module.exports = __webpack_require__(4);
27292729/***/ } )
27302730/******/ ] ) ;
27312731//# sourceMappingURL=json-schema-form-core.js.map
2732- /* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) , __webpack_require__ ( 19 ) . setImmediate ) )
2732+ /* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) , __webpack_require__ ( 18 ) . setImmediate ) )
27332733
27342734/***/ } ) ,
27352735/* 2 */
@@ -2759,8 +2759,7 @@ module.exports = g;
27592759
27602760
27612761/***/ } ) ,
2762- /* 3 */ ,
2763- /* 4 */
2762+ /* 3 */
27642763/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
27652764
27662765"use strict" ;
@@ -2769,18 +2768,18 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
27692768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_json_schema_form_core___default = __webpack_require__ . n ( __WEBPACK_IMPORTED_MODULE_0_json_schema_form_core__ ) ;
27702769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__ ( 0 ) ;
27712770/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__ . n ( __WEBPACK_IMPORTED_MODULE_1_angular__ ) ;
2772- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sf_builder_provider__ = __webpack_require__ ( 14 ) ;
2773- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_schema_form_decorators_provider__ = __webpack_require__ ( 12 ) ;
2774- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_schema_form_provider__ = __webpack_require__ ( 13 ) ;
2775- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_sf_error_message_provider__ = __webpack_require__ ( 15 ) ;
2776- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sf_path_provider__ = __webpack_require__ ( 16 ) ;
2777- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_sf_changed_directive__ = __webpack_require__ ( 7 ) ;
2778- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_sf_field_directive__ = __webpack_require__ ( 8 ) ;
2779- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_sf_message_directive__ = __webpack_require__ ( 10 ) ;
2780- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_sf_array_directive__ = __webpack_require__ ( 6 ) ;
2781- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_sf_key_directive__ = __webpack_require__ ( 9 ) ;
2782- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_sf_schema_directive__ = __webpack_require__ ( 11 ) ;
2783- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_schema_validate_directive__ = __webpack_require__ ( 5 ) ;
2771+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sf_builder_provider__ = __webpack_require__ ( 13 ) ;
2772+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_schema_form_decorators_provider__ = __webpack_require__ ( 11 ) ;
2773+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_schema_form_provider__ = __webpack_require__ ( 12 ) ;
2774+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_sf_error_message_provider__ = __webpack_require__ ( 14 ) ;
2775+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sf_path_provider__ = __webpack_require__ ( 15 ) ;
2776+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_sf_changed_directive__ = __webpack_require__ ( 6 ) ;
2777+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_sf_field_directive__ = __webpack_require__ ( 7 ) ;
2778+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_sf_message_directive__ = __webpack_require__ ( 9 ) ;
2779+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_sf_array_directive__ = __webpack_require__ ( 5 ) ;
2780+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_sf_key_directive__ = __webpack_require__ ( 8 ) ;
2781+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_sf_schema_directive__ = __webpack_require__ ( 10 ) ;
2782+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_schema_validate_directive__ = __webpack_require__ ( 4 ) ;
27842783
27852784
27862785
@@ -2834,7 +2833,7 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
28342833. directive ( 'sfChanged' , __WEBPACK_IMPORTED_MODULE_7_sf_changed_directive__ [ "a" /* default */ ] ) . directive ( 'sfField' , [ '$parse' , '$compile' , '$http' , '$templateCache' , '$interpolate' , '$q' , 'sfErrorMessage' , 'sfPath' , 'sfSelect' , __WEBPACK_IMPORTED_MODULE_8_sf_field_directive__ [ "a" /* default */ ] ] ) . directive ( 'sfMessage' , [ '$injector' , 'sfErrorMessage' , __WEBPACK_IMPORTED_MODULE_9_sf_message_directive__ [ "a" /* default */ ] ] ) . directive ( 'sfNewArray' , [ 'sfSelect' , 'sfPath' , 'schemaForm' , __WEBPACK_IMPORTED_MODULE_10_sf_array_directive__ [ "a" /* default */ ] ] ) . directive ( 'sfSchema' , [ '$compile' , '$http' , '$templateCache' , '$q' , 'schemaForm' , 'schemaFormDecorators' , 'sfSelect' , 'sfPath' , 'sfBuilder' , __WEBPACK_IMPORTED_MODULE_12_sf_schema_directive__ [ "a" /* default */ ] ] ) . directive ( 'schemaValidate' , [ 'sfValidator' , '$parse' , 'sfSelect' , __WEBPACK_IMPORTED_MODULE_13_schema_validate_directive__ [ "a" /* default */ ] ] ) . directive ( 'sfKeyController' , [ 'schemaForm' , 'sfPath' , __WEBPACK_IMPORTED_MODULE_11_sf_key_directive__ [ "a" /* default */ ] ] ) ;
28352834
28362835/***/ } ) ,
2837- /* 5 */
2836+ /* 4 */
28382837/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
28392838
28402839"use strict" ;
@@ -3024,12 +3023,14 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
30243023} ;
30253024
30263025/***/ } ) ,
3027- /* 6 */
3026+ /* 5 */
30283027/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
30293028
30303029"use strict" ;
30313030/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__ ( 0 ) ;
30323031/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__ . n ( __WEBPACK_IMPORTED_MODULE_0_angular__ ) ;
3032+ var _typeof = typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ? function ( obj ) { return typeof obj ; } : function ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ;
3033+
30333034
30343035
30353036/**
@@ -3044,6 +3045,11 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
30443045 link : function link ( scope , element , attrs ) {
30453046 scope . min = 0 ;
30463047
3048+ scope . trackBy = function ( item , index ) {
3049+ if ( item && ( typeof item === 'undefined' ? 'undefined' : _typeof ( item ) ) === 'object' ) return item ;
3050+ return index ;
3051+ } ;
3052+
30473053 scope . modelArray = scope . $eval ( attrs . sfNewArray ) ;
30483054
30493055 // We need to have a ngModel to hook into validation. It doesn't really play well with
@@ -3201,11 +3207,17 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
32013207 return model ;
32023208 } ;
32033209
3204- scope . deleteFromArray = function ( index ) {
3210+ scope . deleteFromArray = function ( item ) {
3211+ var index = scope . modelArray . indexOf ( item ) ;
32053212 var model = scope . modelArray ;
32063213 if ( model ) {
32073214 model . splice ( index , 1 ) ;
32083215 }
3216+
3217+ if ( item . $$hashKey ) {
3218+ scope . destroyed = item . $$hashKey ;
3219+ }
3220+
32093221 return model ;
32103222 } ;
32113223
@@ -3255,7 +3267,7 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
32553267} ;
32563268
32573269/***/ } ) ,
3258- /* 7 */
3270+ /* 6 */
32593271/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
32603272
32613273"use strict" ;
@@ -3301,7 +3313,7 @@ __WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('schemaForm', deps)
33013313} ;
33023314
33033315/***/ } ) ,
3304- /* 8 */
3316+ /* 7 */
33053317/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
33063318
33073319"use strict" ;
@@ -3586,9 +3598,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
35863598 // in the form definition.
35873599 scope . $on ( '$destroy' , function ( ) {
35883600 var key = scope . getKey ( ) ;
3601+ var arrayIndex = typeof scope . arrayIndex == 'number' ? scope . arrayIndex + 1 : 0 ;
35893602
35903603 // If the entire schema form is destroyed we don't touch the model
3591- if ( ! scope . externalDestructionInProgress ) {
3604+ if ( ! scope . externalDestructionInProgress && ( ! scope . model . $$hashKey || scope . model . $$hashKey === scope . destroyed ) ) {
35923605 var destroyStrategy = form . destroyStrategy || scope . options && scope . options . destroyStrategy || 'remove' ;
35933606 // No key no model, and we might have strategy 'retain'
35943607 if ( key && destroyStrategy !== 'retain' ) {
@@ -3630,7 +3643,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
36303643} ;
36313644
36323645/***/ } ) ,
3633- /* 9 */
3646+ /* 8 */
36343647/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
36353648
36363649"use strict" ;
@@ -3669,7 +3682,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
36693682} ; ;
36703683
36713684/***/ } ) ,
3672- /* 10 */
3685+ /* 9 */
36733686/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
36743687
36753688"use strict" ;
@@ -3773,7 +3786,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
37733786} ;
37743787
37753788/***/ } ) ,
3776- /* 11 */
3789+ /* 10 */
37773790/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
37783791
37793792"use strict" ;
@@ -4003,7 +4016,7 @@ FIXME: real documentation
40034016} ;
40044017
40054018/***/ } ) ,
4006- /* 12 */
4019+ /* 11 */
40074020/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
40084021
40094022"use strict" ;
@@ -4546,7 +4559,7 @@ FIXME: real documentation
45464559} ; ;
45474560
45484561/***/ } ) ,
4549- /* 13 */
4562+ /* 12 */
45504563/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
45514564
45524565"use strict" ;
@@ -4685,7 +4698,7 @@ FIXME: real documentation
46854698} ;
46864699
46874700/***/ } ) ,
4688- /* 14 */
4701+ /* 13 */
46894702/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
46904703
46914704"use strict" ;
@@ -5013,7 +5026,7 @@ FIXME: real documentation
50135026} ;
50145027
50155028/***/ } ) ,
5016- /* 15 */
5029+ /* 14 */
50175030/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
50185031
50195032"use strict" ;
@@ -5150,7 +5163,7 @@ FIXME: real documentation
51505163} ;
51515164
51525165/***/ } ) ,
5153- /* 16 */
5166+ /* 15 */
51545167/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
51555168
51565169"use strict" ;
@@ -5190,7 +5203,7 @@ var sfPathProviderClass = function () {
51905203/* harmony default export */ __webpack_exports__ [ "a" ] = sfPathProviderClass ;
51915204
51925205/***/ } ) ,
5193- /* 17 */
5206+ /* 16 */
51945207/***/ ( function ( module , exports ) {
51955208
51965209// shim for using process in browser
@@ -5376,7 +5389,7 @@ process.umask = function() { return 0; };
53765389
53775390
53785391/***/ } ) ,
5379- /* 18 */
5392+ /* 17 */
53805393/***/ ( function ( module , exports , __webpack_require__ ) {
53815394
53825395/* WEBPACK VAR INJECTION */ ( function ( global , process ) { ( function ( global , undefined ) {
@@ -5566,10 +5579,10 @@ process.umask = function() { return 0; };
55665579 attachTo . clearImmediate = clearImmediate ;
55675580} ( typeof self === "undefined" ? typeof global === "undefined" ? this : global : self ) ) ;
55685581
5569- /* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) , __webpack_require__ ( 17 ) ) )
5582+ /* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 2 ) , __webpack_require__ ( 16 ) ) )
55705583
55715584/***/ } ) ,
5572- /* 19 */
5585+ /* 18 */
55735586/***/ ( function ( module , exports , __webpack_require__ ) {
55745587
55755588var apply = Function . prototype . apply ;
@@ -5622,18 +5635,17 @@ exports._unrefActive = exports.active = function(item) {
56225635} ;
56235636
56245637// setimmediate attaches itself to the global object
5625- __webpack_require__ ( 18 ) ;
5638+ __webpack_require__ ( 17 ) ;
56265639exports . setImmediate = setImmediate ;
56275640exports . clearImmediate = clearImmediate ;
56285641
56295642
56305643/***/ } ) ,
5631- /* 20 */ ,
5632- /* 21 */
5644+ /* 19 */
56335645/***/ ( function ( module , exports , __webpack_require__ ) {
56345646
56355647__webpack_require__ ( 1 ) ;
5636- module . exports = __webpack_require__ ( 4 ) ;
5648+ module . exports = __webpack_require__ ( 3 ) ;
56375649
56385650
56395651/***/ } )
0 commit comments