refactor($compile): improve readability on conditional assignment
refactor($compile): improve readability on conditional assignment

Use ternary operator instead of if statement

Closes #5065

campersau/angular.js,campersau/angular.js