provide key on blockModel for angularJS performance optimization

This commit is contained in:
Niels Lyngsø
2020-03-06 10:41:22 +01:00
parent 8a1b56b475
commit 1715e1747f
2 changed files with 2 additions and 1 deletions
@@ -152,6 +152,7 @@
}
var blockModel = {};
blockModel.key = String.CreateGuid();
blockModel.config = angular.copy(blockConfiguration);
blockModel.labelInterpolator = $interpolate(blockModel.config.label);
@@ -5,7 +5,7 @@
<div ui-sortable="vm.sortableOptions" ng-model="vm.blocks">
<div ng-repeat="blockItem in vm.blocks">
<div ng-repeat="blockItem in vm.blocks track by blockItem.key">
<button
type="button"