本文整理匯總了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 ]);
}