本文整理汇总了TypeScript中@fuse/utils.FuseUtils.handleize方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FuseUtils.handleize方法的具体用法?TypeScript FuseUtils.handleize怎么用?TypeScript FuseUtils.handleize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@fuse/utils.FuseUtils
的用法示例。
在下文中一共展示了FuseUtils.handleize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: saveProduct
/**
* Save product
*/
saveProduct(): void
{
const data = this.productForm.getRawValue();
data.handle = FuseUtils.handleize(data.name);
this._ecommerceProductService.saveProduct(data)
.then(() => {
// Trigger the subscription with new data
this._ecommerceProductService.onProductChanged.next(data);
// Show the success message
this._matSnackBar.open('Product saved', 'OK', {
verticalPosition: 'top',
duration : 2000
});
});
}
示例2: constructor
/**
* Constructor
*
* @param product
*/
constructor(product?)
{
product = product || {};
this.id = product.id || FuseUtils.generateGUID();
this.name = product.name || '';
this.handle = product.handle || FuseUtils.handleize(this.name);
this.description = product.description || '';
this.categories = product.categories || [];
this.tags = product.tags || [];
this.images = product.images || [];
this.priceTaxExcl = product.priceTaxExcl || 0;
this.priceTaxIncl = product.priceTaxIncl || 0;
this.taxRate = product.taxRate || 0;
this.comparedPrice = product.comparedPrice || 0;
this.quantity = product.quantity || 0;
this.sku = product.sku || 0;
this.width = product.width || 0;
this.height = product.height || 0;
this.depth = product.depth || 0;
this.weight = product.weight || 0;
this.extraShippingFee = product.extraShippingFee || 0;
this.active = product.active || true;
}