-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace angular.forEach with Utilities.forEach #10759
Replace angular.forEach with Utilities.forEach #10759
Conversation
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @bjarnef, as always. Wonder if it's worth considering adding JS lint rules for the angular methods?
@bjarnef @nathanwoulfe - ehmmmm... not sure what's happening here?? Help!! 😁 This started happening with this commit, so something is not quite right here.. 10759.mp4 |
@nul800sebastiaan strange. It should be the same just with a null and undefined check. Umbraco-CMS/src/Umbraco.Web.UI.Client/src/utilities.js Lines 109 to 117 in 7cccbb3
It seems there's something failing in Somewhere here I guess: Umbraco-CMS/src/Umbraco.Web.UI.Client/src/common/directives/util/umbkeyboardlist.directive.js Lines 61 to 81 in 56790f7
|
@nul800sebastiaan I think it fails here because |
I'm not sure, currently I don't understand what this means! 😅 😊 I'd love some help here if you have a bit of time! |
It seems
Also to clearify: https://stackoverflow.com/a/31096661/1693918
|
Prerequisites
If there's an existing issue for this PR then this fixes #7718
Description
Previous this PR #7928 was submitted to replace
angular.forEach
However it seems not all references has been replaced or maybe because other PRs has been merged afterwards.
It can use vanilla JS
array.forEach
orUtilities.forEach
.Current both versions are used in core, but
Utilities.forEach
is a bit safer as it only iterate if array variable not is null or undefined.