本文整理汇总了TypeScript中@ember/controller.extend函数的典型用法代码示例。如果您正苦于以下问题:TypeScript extend函数的具体用法?TypeScript extend怎么用?TypeScript extend使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了extend函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: inject
import Controller, { inject } from "@ember/controller";
Controller.extend({
queryParams: ["category"],
category: null,
isExpanded: false,
first: inject(),
second: inject('second'),
toggleBody() {
this.toggleProperty("isExpanded");
}
});
示例2: model
import Controller from '@ember/controller';
class MyModel extends DS.Model {}
declare module 'ember-data/types/registries/model' {
export default interface ModelRegistry {
'my-model': MyModel;
}
}
Ember.Route.extend({
model(): any {
return this.store.findAll('my-model');
}
});
Controller.extend({
actions: {
create(): any {
this.queryParams;
return this.store.createRecord('my-model');
}
}
});
Ember.DataAdapter.extend({
test() {
this.store.findRecord('my-model', 123);
}
});
示例3: toggleBody
import Controller from '@ember/controller';
Controller.extend ({
queryParams: ['category'],
category: null,
isExpanded: false,
toggleBody() {
this.toggleProperty('isExpanded');
}
});