refactor($compile): improve readability on conditional assignment

Use ternary operator instead of if statement

Closes #5065
This commit is contained in:
Wladimir Coka
2013-11-21 16:31:27 -05:00
committed by Peter Bacon Darwin
parent 1453fb72ff
commit 78d2620576

View File

@@ -1441,11 +1441,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn;
if (compileNode === linkNode) {
attrs = templateAttrs;
} else {
attrs = shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
}
attrs = (compileNode === linkNode)
? templateAttrs
: shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
$element = attrs.$$element;
if (newIsolateScopeDirective) {