refactor($compile): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
This commit is contained in:
committed by
Peter Bacon Darwin
parent
3ce56b739c
commit
dbb21b1531
+3
-5
@@ -1417,11 +1417,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) {
|
||||
|
||||
Reference in New Issue
Block a user