本文整理汇总了TypeScript中@fuse/utils.FuseUtils类的典型用法代码示例。如果您正苦于以下问题:TypeScript FuseUtils类的具体用法?TypeScript FuseUtils怎么用?TypeScript FuseUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FuseUtils类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
/**
* Constructor
*
* @param order
*/
constructor(order?)
{
order = order || {};
this.id = order.id || FuseUtils.generateGUID();
this.reference = order.reference || FuseUtils.generateGUID();
this.subtotal = order.subtotal || 0;
this.tax = order.tax || 0;
this.discount = order.discount || 0;
this.total = order.total || 0;
this.date = order.date || '';
this.customer = order.customer || {};
this.products = order.products || [];
this.status = order.status || [];
this.payment = order.payment || {};
this.shippingDetails = order.shippingDetails || [];
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:21,代码来源:order.model.ts
示例2: Promise
return new Promise((resolve, reject) => {
// Generate a new id
const chatId = FuseUtils.generateGUID();
// Prepare the chat object
const chat = {
id : chatId,
dialog: []
};
// Prepare the chat list entry
const chatListItem = {
chatId : chatId,
contactId : contactId,
lastMessageTime: '2017-02-18T10:30:18.931Z'
};
// Add new chat list item to the user's chat list
this.user.chatList.push(chatListItem);
// Post the created chat to the server
this._httpClient.post('api/chat-panel-chats', {...chat})
.subscribe(() => {
// Post the updated user data to the server
this._httpClient.post('api/chat-panel-user/' + this.user.id, this.user)
.subscribe(() => {
// Resolve the promise
resolve();
});
}, reject);
});
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:34,代码来源:chat-panel.service.ts
示例3: Todo
.subscribe((todos: any) => {
this.todos = todos.map(todo => {
return new Todo(todo);
});
this.todos = FuseUtils.filterArrayByString(this.todos, this.searchText);
this.onTodosChanged.next(this.todos);
resolve(this.todos);
});
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:11,代码来源:todo.service.ts
示例4: 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;
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:28,代码来源:product.model.ts
示例5: constructor
/**
* Constructor
*
* @param board
*/
constructor(board)
{
this.name = board.name || 'Untitled Board';
this.uri = board.uri || 'untitled-board';
this.id = board.id || FuseUtils.generateGUID();
this.settings = board.settings || {
color : '',
subscribed : true,
cardCoverImages: true
};
this.lists = [];
this.cards = [];
this.members = board.members || sampleMembers;
this.labels = board.labels || sampleLabels;
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:20,代码来源:board.model.ts
示例6: constructor
/**
* Constructor
*
* @param card
*/
constructor(card)
{
this.id = card.id || FuseUtils.generateGUID();
this.name = card.name || '';
this.description = card.description || '';
this.idAttachmentCover = card.idAttachmentCover || '';
this.idMembers = card.idMembers || [];
this.idLabels = card.idLabels || [];
this.attachments = card.attachments || [];
this.subscribed = card.subscribed || true;
this.checklists = card.checklists || [];
this.checkItems = card.checkItems || 0;
this.checkItemsChecked = card.checkItemsChecked || 0;
this.comments = card.comments || [];
this.activities = card.activities || [];
this.due = card.due || '';
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:22,代码来源:card.model.ts
示例7: constructor
/**
* Constructor
*
* @param contact
*/
constructor(contact)
{
{
this.id = contact.id || FuseUtils.generateGUID();
this.name = contact.name || '';
this.lastName = contact.lastName || '';
this.avatar = contact.avatar || 'assets/images/avatars/profile.jpg';
this.nickname = contact.nickname || '';
this.company = contact.company || '';
this.jobTitle = contact.jobTitle || '';
this.email = contact.email || '';
this.phone = contact.phone || '';
this.address = contact.address || '';
this.birthday = contact.birthday || '';
this.notes = contact.notes || '';
}
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:22,代码来源:contact.model.ts
示例8: 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
});
});
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:21,代码来源:product.component.ts
示例9: Promise
return new Promise((resolve, reject) => {
const contact = this.contacts.find((item) => {
return item.id === contactId;
});
const chatId = FuseUtils.generateGUID();
const chat = {
id : chatId,
dialog: []
};
const chatListItem = {
contactId : contactId,
id : chatId,
lastMessageTime: '2017-02-18T10:30:18.931Z',
name : contact.name,
unread : null
};
// Add new chat list item to the user's chat list
this.user.chatList.push(chatListItem);
// Post the created chat
this._httpClient.post('api/chat-chats', {...chat})
.subscribe((response: any) => {
// Post the new the user data
this._httpClient.post('api/chat-user/' + this.user.id, this.user)
.subscribe(newUserData => {
// Update the user data from server
this.getUser().then(updatedUser => {
this.onUserUpdated.next(updatedUser);
resolve(updatedUser);
});
});
}, reject);
});
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:40,代码来源:chat.service.ts
示例10:
(entities, searchText) => {
const arr = Object.keys(entities).map((id) => entities[id]);
return FuseUtils.filterArrayByString(arr, searchText);
}
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:4,代码来源:mails.selectors.ts
注:本文中的@fuse/utils.FuseUtils类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论