当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript FuseUtils.generateGUID方法代码示例

本文整理汇总了TypeScript中@fuse/utils.FuseUtils.generateGUID方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FuseUtils.generateGUID方法的具体用法?TypeScript FuseUtils.generateGUID怎么用?TypeScript FuseUtils.generateGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@fuse/utils.FuseUtils的用法示例。


在下文中一共展示了FuseUtils.generateGUID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: constructor

 /**
  * Constructor
  *
  * @param list
  */
 constructor(list)
 {
     this.id = list.id || FuseUtils.generateGUID();
     this.name = list.name || '';
     this.idCards = [];
 }
开发者ID:karthik12ui,项目名称:fuse-angular-full,代码行数:11,代码来源:list.model.ts


注:本文中的@fuse/utils.FuseUtils.generateGUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。