angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ternary not working in angular 1.7

Open rbansalit opened this issue 13 years ago • 2 comments

As discussed in https://github.com/angular/angular.js/blob/master/CHANGELOG.md

$parse: add support for ternary operators to parser

But it does not work . My expression is

var getter = $parse('first + second == third ? "Rohit Bansal" : "Not Rohit" '); var context = {first:"Rohit",second:"Bansal",third:"RohitBansal"}; $scope.result = getter(context);

Where as var getter = $parse('(first + second == third )&& "Rohit Bansal" || "Not Rohit"'); working nice

http://plnkr.co/edit/Ws1yQk?p=preview

rbansalit avatar Jun 07 '13 10:06 rbansalit

I think you are in an error the version 1.7 does not exist; the version you reference is 1.1.5 i think you are using 1.0.7

il-juggler avatar Jun 08 '13 21:06 il-juggler

Thanks a lot. Its working fine for me now using 1.1.5.

rbansalit avatar Jun 09 '13 06:06 rbansalit