本文整理汇总了TypeScript中ember.computed.alias方法的典型用法代码示例。如果您正苦于以下问题:TypeScript computed.alias方法的具体用法?TypeScript computed.alias怎么用?TypeScript computed.alias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ember.computed
的用法示例。
在下文中一共展示了computed.alias方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
}).create();
assertType<string>(person3.get('firstName'));
assertType<string>(person3.get('fullName'));
const person4 = Person.extend({
firstName: Ember.computed(() => 'Fred'),
fullName: Ember.computed(() => 'Fred Smith')
}).create();
assertType<string>(person4.get('firstName'));
assertType<string>(person4.get('fullName'));
// computed property macros
const objectWithComputedProperties = Ember.Object.extend({
alias: Ember.computed.alias('foo'),
and: Ember.computed.and('foo', 'bar', 'baz', 'qux'),
bool: Ember.computed.bool('foo'),
collect: Ember.computed.collect('foo', 'bar', 'baz', 'qux'),
deprecatingAlias: Ember.computed.deprecatingAlias('foo', {
id: 'hamster.deprecate-banana',
until: '3.0.0'
}),
empty: Ember.computed.empty('foo'),
equalNumber: Ember.computed.equal('foo', 1),
equalString: Ember.computed.equal('foo', 'bar'),
equalObject: Ember.computed.equal('foo', {}),
filter: Ember.computed.filter('foo', (item) => item === 'bar'),
filterBy1: Ember.computed.filterBy('foo', 'bar'),
filterBy2: Ember.computed.filterBy('foo', 'bar', false),
gt: Ember.computed.gt('foo', 3),