Remove usages of angular.forEach in settings and translation

This commit is contained in:
Kenn Jacobsen
2020-07-29 08:51:39 +02:00
committed by Sebastiaan Janssen
parent 2e22ada442
commit 56ca7fa603
5 changed files with 6 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ function DictionaryListController($scope, $location, dictionaryResource, localiz
dictionaryResource.getList()
.then(function (data) {
vm.items = data;
angular.forEach(vm.items, function(item){
vm.items.forEach(function(item){
item.style = { "paddingLeft": item.level * 10 };
});
vm.loading = false;

View File

@@ -68,7 +68,7 @@
//load all culture/languages
promises.push(languageResource.getCultures().then(function (culturesDictionary) {
var cultures = [];
angular.forEach(culturesDictionary, function (value, key) {
Object.entries(culturesDictionary).forEach(function ([key, value]) {
cultures.push({
name: key,
displayName: value

View File

@@ -181,7 +181,7 @@
function getFilterName(array) {
var name = "All";
var found = false;
angular.forEach(array, function (item) {
array.forEach(function (item) {
if (item.selected) {
if (!found) {
name = item.name

View File

@@ -102,7 +102,7 @@ function RelationTypeEditController($scope, $routeParams, relationTypeResource,
function formatDates(relations) {
if (relations) {
userService.getCurrentUser().then(function (currentUser) {
angular.forEach(relations, function (relation) {
relations.forEach(function (relation) {
relation.timestampFormatted = dateHelper.getLocalDate(relation.createDate, currentUser.locale, 'LLL');
});
});

View File

@@ -549,7 +549,7 @@
var availableMasterTemplates = [];
// filter out the current template and the selected master template
angular.forEach(vm.templates, function (template) {
vm.templates.forEach(function (template) {
if (template.alias !== vm.template.alias && template.alias !== vm.template.masterTemplateAlias) {
var templatePathArray = template.path.split(',');
// filter descendant templates of current template
@@ -602,7 +602,7 @@
function getMasterTemplateName(masterTemplateAlias, templates) {
if (masterTemplateAlias) {
var templateName = "";
angular.forEach(templates, function (template) {
templates.forEach(function (template) {
if (template.alias === masterTemplateAlias) {
templateName = template.name;
}