mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-20 07:15:31 +08:00
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
1453fb72ff
commit
78d2620576
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user