ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Nechiporenko (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-19401) Add new macros `ifThenElseByKeys` and write UT
Date Fri, 06 Jan 2017 13:52:59 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-19401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15804584#comment-15804584
] 

Oleg Nechiporenko commented on AMBARI-19401:
--------------------------------------------

Committed to trunk

> 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)

Mime
View raw message