-
Notifications
You must be signed in to change notification settings - Fork 27.4k
refactor: simplify conditional assignment statements via ternary operator #5065
Conversation
The minification process actually does this sort of thing already. As an example here is the relevant section of minified code from $parse:
The main decision over making changes is whether it is more readable. |
} | ||
childBoundTranscludeFn = (afterTemplateNodeLinkFn.transclude) | ||
? createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude) | ||
: boundTranscludeFn; |
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.
The compiler code is complex enough as it is. Spelling out the if statements here seems to me clearer.
@dimirc - can you ensure you have signed the CLA. If you change the pull request please ensure that you follow the commit message guidelines, with a different commit for each file that you change: see https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md |
Use ternary operator instead of if statement
Use ternary operator instead of if statement
Use ternary operator instead of if statement
Use logical OR operator instead of if statement
Use logical OR operator instead of if statement
@petebacondarwin commits changed. Btw, I signed CLA yesterday (name: Wladimir Coka) |
We can't find your CLA submission. Can you sign it again please? |
@petebacondarwin ok no problem, I just signed CLA again with Sign Electronically option |
@petebacondarwin can you get this in please? |
Use ternary operator instead of if statement Closes #5065
Use ternary operator instead of if statement Closes #5065
Use logical OR operator instead of if statement Closes #5065
Use ternary operator instead of if statement Closes #5065
Use ternary operator instead of if statement Closes #5065
Use ternary operator instead of if statement Closes #5065
Use logical OR operator instead of if statement Closes #5065
Use ternary operator instead of if statement Closes angular#5065
Use ternary operator instead of if statement Closes angular#5065
Use ternary operator instead of if statement Closes angular#5065
Use logical OR operator instead of if statement Closes angular#5065
No description provided.