本文整理汇总了TypeScript中twc/polymer.observe函数的典型用法代码示例。如果您正苦于以下问题:TypeScript observe函数的具体用法?TypeScript observe怎么用?TypeScript observe使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了observe函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
@observe('collection.*')
_collectionChanged(collection: any) {
TemplateUtil.render({
value: collection.base,
scope: 'hydra-collection'
}, this.$.table);
}
示例2:
@observe('resource')
_getEntrypoint(resource: IHydraResource) {
resource.apiDocumentation.getEntrypoint()
.then((entrypoint: IHydraResponse) => {
this._setEntrypoint(entrypoint.root);
})
.catch(() => {
this._setEntrypoint({});
});
}
示例3: getTitle
@observe('resource', 'propertyId')
getTitle(resource: IHydraResource, propertyId: string) {
if (resource && resource.apiDocumentation) {
let properties = resource.types.map((t: IClass) => resource.apiDocumentation.getProperties(t));
const supportedProps = Utils.flatten(properties);
const [ supportedProp, ...tail ] = supportedProps.filter((prop: ISupportedProperty) => prop.property.id === propertyId);
if (supportedProp) {
this._setSupportedProperty(supportedProp);
return;
}
}
this._setSupportedProperty(propertyId);
}
示例4: clearSelection
@observe('supportedOperations')
clearSelection() {
this.$.selectedOperation = null;
this.$.supportedOperations.value = '';
}
示例5: updateFabStyle
@observe('hasOperations')
updateFabStyle(hasOperations: boolean) {
this.updateStyles();
}
示例6: returnsObserver
@observe('supportedOperation.returns')
returnsObserver(returns:IClass) {
this._setHasReturns(!!returns && returns.id !== nothing);
setTitle.call(this, returns, this._setReturnsTitle);
}
示例7: expectsObserver
@observe('supportedOperation.expects')
expectsObserver(expects:IClass) {
this._setHasExpects(!!expects && expects.id !== nothing);
setTitle.call(this, expects, this._setExpectsTitle);
}
示例8: getProperties
@observe('supportedClass')
getProperties(supportedClass:IClass) {
this.$.supportedProperties.value = null;
this.$.classTabs.selected = 0;
}
示例9:
@observe('resource')
_onResourceChanged(resource: IHydraResource) {
this._setDisplayedResources([ resource ]);
}