Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit dbb21b1

Browse files
dimircpetebacondarwin
authored andcommitted
refactor($compile): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
1 parent 3ce56b7 commit dbb21b1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/ng/compile.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,11 +1417,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
14171417
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
14181418
var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn;
14191419

1420-
if (compileNode === linkNode) {
1421-
attrs = templateAttrs;
1422-
} else {
1423-
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
1424-
}
1420+
attrs = (compileNode === linkNode)
1421+
? templateAttrs
1422+
: shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
14251423
$element = attrs.$$element;
14261424

14271425
if (newIsolateScopeDirective) {

0 commit comments

Comments
 (0)