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

Commit 78d2620

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

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/ng/compile.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1441,11 +1441,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
14411441
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
14421442
var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn;
14431443

1444-
if (compileNode === linkNode) {
1445-
attrs = templateAttrs;
1446-
} else {
1447-
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
1448-
}
1444+
attrs = (compileNode === linkNode)
1445+
? templateAttrs
1446+
: shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
14491447
$element = attrs.$$element;
14501448

14511449
if (newIsolateScopeDirective) {

0 commit comments

Comments
 (0)