[
https://issues.apache.org/jira/browse/AMBARI-19401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15804393#comment-15804393
]
Oleg Nechiporenko commented on AMBARI-19401:
--------------------------------------------
+1 by [~atkach] on the review board
> Add new macros `ifThenElseByKeys` and write UT
> ----------------------------------------------
>
> Key: AMBARI-19401
> URL: https://issues.apache.org/jira/browse/AMBARI-19401
> Project: Ambari
> Issue Type: Task
> Components: ambari-web
> Affects Versions: 3.0.0
> Reporter: Oleg Nechiporenko
> Assignee: Oleg Nechiporenko
> Fix For: 3.0.0
>
> Attachments: AMBARI-19401.patch
>
>
> A computed property that returns value for trueKey property if dependent
> value is true and falseKey-value otherwise
> {code:javascript}
> var o = Em.Object.create({
> p1: true,
> p2: 1,
> p3: 2,
> p4: Em.computed.ifThenElseByKeys('p1', 'p2', 'p3')
> });
> console.log(o.get('p4')); // 1
> o.set('p1', false);
> console.log(o.get('p4')); // 2
> o.set('p3', 3);
> console.log(o.get('p4')); // 3
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)