angular/angular.js — pull request #5434 by rodyhaddad (2013-12-16 18:22:13+00:00)
Title: feat($parse): allow for assignments in ternary operator branches

Currently in angular expressions, the ternary operator is defined as:

```
TernaryOperatorExpression :
LogicalORExpression ? LogicalORExpression : LogicalORExpression
```

but [in javascript](http://es5.github.io/#x11.12), it's
```
TernaryOperatorExpression :
LogicalORExpression ? AssignmentExpression : AssignmentExpression
```

So I thought it would be good for ternary operator in ng-expression to behave the same way as in js.

----
Given the following expression
```js
1 ? a : b = null
```

currently it's evaluated as
```js
(1 ? a : b) = null
```
which throws an error

It will now be evaluated as
```js
1 ? a : (b = null)
```