Oleg Nechiporenko created AMBARI-13971:
------------------------------------------
Summary: Implement Em.computed macros (2)
Key: AMBARI-13971
URL: https://issues.apache.org/jira/browse/AMBARI-13971
Project: Ambari
Issue Type: Task
Components: ambari-web
Affects Versions: 2.2.0
Reporter: Oleg Nechiporenko
Assignee: Oleg Nechiporenko
Fix For: 2.2.0
||Name (Em.computed.*)||Description||
|notExistsIn|A computed property that returns true if dependent property
doesn't exist in the needed values|
|percents|A computed property that returns result of calculation
{{dependentProperty1/dependentProperty2 * 100}}. If accuracy is 0 (by default),
result is rounded to integer. Otherwise - result is float with provided
accuracy|
|formatRole|A computed property that returns result of {{App.format.role}} for
dependent value|
|sumBy|A computed property that returns sum of the named property in the each
collection's item|
|i18nFormat|A computed property that returns I18n-string formatted with
dependent properties|
|concat|A computed property that returns dependent values joined with separator|
|firstNotBlank|A computed property that returns first not blank value from
dependent values. Based on {{Ember.isBlank}}. Dependent values order affects
the result|
Add ability for {{`or`}}, {{`and`}} macros to handle dependent keys with
inversion. Example:
{code}
var a = Em.Object.create({
prop1: true,
prop2: true,
prop3: true,
prop4: Em.computed.and('prop1', '!prop2', 'prop3')
});
a.get('prop4'); // `false`, because `prop2` is taken inverted
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)