replace angular.forEach with native forEach

This commit is contained in:
Niels Lyngsø
2020-04-29 14:57:15 +02:00
parent 03fc9cae3c
commit 42f9466b1d
2 changed files with 8 additions and 8 deletions
@@ -45,7 +45,7 @@
function checkErrorsOnOtherVariants() {
var check = false;
angular.forEach(scope.content.variants, function (variant) {
scope.content.variants.forEach( function (variant) {
if (variant.active !== true && scope.variantHasError(variant)) {
check = true;
}
@@ -70,7 +70,7 @@
function onInit() {
// find default + check if we have variants.
angular.forEach(scope.content.variants, function (variant) {
scope.content.variants.forEach(, function (variant) {
if (variant.language !== null && variant.language.isDefault) {
scope.vm.defaultVariant = variant;
}
@@ -89,7 +89,7 @@
scope.vm.variantMenu = [];
if (scope.vm.hasCulture) {
angular.forEach(scope.content.variants, (v) => {
scope.content.variants.forEach( (v) => {
if (v.language !== null && v.segment === null) {
var variantMenuEntry = {
key: String.CreateGuid(),
@@ -101,7 +101,7 @@
}
});
} else {
angular.forEach(scope.content.variants, (v) => {
scope.content.variants.forEach( (v) => {
scope.vm.variantMenu.push({
key: String.CreateGuid(),
variant: v
@@ -110,13 +110,13 @@
}
angular.forEach(scope.editor.variantApps, (app) => {
scope.editor.variantApps.forEach( (app) => {
if (app.alias === "umbContent") {
app.anchors = scope.content.tabs;
}
});
angular.forEach(scope.content.variants, function (variant) {
scope.content.variants.forEach( function (variant) {
unsubscribe.push(serverValidationManager.subscribe(null, variant.language !== null ? variant.language.culture : null, null, onVariantValidation, variant.segment));
});
@@ -68,7 +68,7 @@
// and disable selection for the others
if(selectedVariant.save && selectedVariant.segment == null && selectedVariant.language && selectedVariant.language.isMandatory) {
angular.forEach(vm.variants, function(variant){
vm.variants.forEach(function(variant) {
if(!variant.save) {
// keep track of the variants we automaically select
// so we can remove the selection again
@@ -88,7 +88,7 @@
// We also want to enable all checkboxes again
if(!selectedVariant.save && selectedVariant.segment == null && selectedVariant.language && selectedVariant.language.isMandatory) {
angular.forEach(vm.variants, function(variant){
vm.variants.forEach( function(variant){
// check if variant was auto selected, then deselect
if(_.contains(autoSelectedVariants, variant)) {