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


TypeScript UUID.UUID方法代码示例

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


在下文中一共展示了UUID.UUID方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 .then((result: any) => {
     // Load transcript by paragraph
     for (let paragraphs of result.revisedData){
         // Load words within each paragraph
         for (let words of paragraphs.paragraph){
             if (words.paragraphMarker){
                 revisedParagraph.push({
                     paragraphMarker: true
                 });
             } else {
                 revisedParagraph.push({
                     'id': UUID.UUID(),
                     'start': words.start,
                     'end': words.end,
                     'word': words.word
                 });
             }
         }
         this.revisedDataSet.push({
             //TODO 'speaker': revisedParagraph.speaker
             'id': UUID.UUID(),
             'isEditing': false,
             'paragraph': revisedParagraph
         });
         revisedParagraph = [];
     }
     this.transcriptName = result.name;
     // Load audio into wavesurfer from transcript
     this.wavesurfer.load(result.audioURL);
 }, (errorCode: string) => {
开发者ID:skoocda,项目名称:spreza,代码行数:30,代码来源:transcript.ts

示例2: processEdits

 private processEdits(paragraph: any){
     // Obtain all of the span elements in the transcript editor
     let spans = document.getElementById('editable-section').children;
     // Iterate through each span tag in the collection
     let lenSpanCollection = spans.length;
     for (let i = 0; i < lenSpanCollection; i++){
         if (spans[i].hasAttribute('id')){
             // Obtain all of the words within the current span tag
             let unfilteredWords = spans[i].textContent.split(/[\x20|\xa0]/);
             let filteredWords = spans[i].textContent.split(' ');
             let words = filteredWords.filter(Boolean);
             let lenWords = words.length;
             /* Determine if words need to be concatenated
              * by checking if the last unfiltered is not empty
              * which would indicate the existence of a &nbsp char
              */
             if (unfilteredWords[unfilteredWords.length - 1] != ''){
                 // Handle edge case where first letter is modified
                 if (lenWords > 1 && spans[i].nextSibling ){
                     let lastWord = words[words.length - 1];
                     let nextWord = spans[i].nextSibling.textContent;
                     if (nextWord){
                         spans[i].nextSibling.textContent = lastWord
                             + nextWord;
                         words.pop();
                         lenWords--;
                     }
                 }
             } //TODO
             // Find the position to modify and insert the words
             let insertionIndex = 0;
             for (let revisedWord of paragraph){
                 if (revisedWord.id 
                     === spans[i].attributes.getNamedItem('id').value){
                     break;
                 }
                 insertionIndex++;
             }
             // Modify the original word if non empty
             if (words[0].trim() !== ''){
                 paragraph[insertionIndex].word = words[0].trim();
             }
             // Insert any new words if they're non empty
             for (let i = 1; i < lenWords; i++){
                 if (words[i].trim() !== ''){
                     insertionIndex++;
                     paragraph.splice(insertionIndex, 0, {
                         'id': UUID.UUID(),
                         'word': words[i].trim(),
                         'start': -1,
                         'end': -1
                     });
                 }
             }
             this.isTranscriptModified = true;
         }
         else {
         }
     }
 }
开发者ID:skoocda,项目名称:spreza,代码行数:60,代码来源:transcript.ts

示例3: onConfirmLink

 private onConfirmLink(){
     // Ensure that the form is valid
     if (this.uploadLinkForm.valid){
         // Obtain the link from the form
         let link = this.uploadLinkForm.controls['link'].value;
         let origin = 'youtube-play';
         // Set the origin to vimeo if the url is a vimeo link
         if (link.includes('vimeo')){
             origin = 'vimeo';
         }
         // Or to soundcloud if it's from soundcloud
         if (link.includes('soundcloud')){
             origin = 'soundcloud';
         }
         // Populate pending uploads data list with link and origin
         this.pendingUploadsDataSet.push({
             'id': UUID.UUID(),
             'link': link,
             'origin': origin,
             'isNameValid': true,
             'isUploading': false
         });
         // Clear the video upload link forum
         this.uploadLinkForm.reset();
     }
 }
开发者ID:skoocda,项目名称:spreza,代码行数:26,代码来源:profile.ts

示例4: onDrop

 private onDrop(event: any){
     // Cancel event and hover styling
     this.onDropLeave(event);
     // Fetch FileList object
     let fileList = event.target.files || event.dataTransfer.files;
     // Process all File objects
     for (let file of fileList){
         // Check if the MIME type of the file is permitted
         if (this.permittedMimes.includes(file.type)){
             // Populate pending uploads data list with file and origin
             this.pendingUploadsDataSet.push({
                 'id': UUID.UUID(),
                 'file': file,
                 'origin': 'desktop',
                 'isNameValid': true,
                 'isUploading': false
             });
         } else {
             // Display error message for non-permitted MIME type files
             toastr.error(
                 this.commonService.getUXClientMessage('ERR_PERMITTED_FILE'),
                 'Uh Oh...'
             );
             return false;
         }
     }
 }
开发者ID:skoocda,项目名称:spreza,代码行数:27,代码来源:profile.ts

示例5: add

 add(desc: string) {
   const todo: Todo = {
     id: UUID.UUID(),
     desc: desc,
     completed: false
   };
   this.store$.dispatch(new TodoAddTodoAction(todo));
 }
开发者ID:tensen100,项目名称:myNgrx,代码行数:8,代码来源:todo-index.component.ts

示例6: constructor

 constructor( attrs: ITodo) {
   this.id = UUID.UUID();
   this.title = attrs.title;
   this.dueDate = attrs.dueDate;
   this.priority = attrs.priority || TodoPriority.Medium;
   this.completed = attrs.completed != null ? attrs.completed : false;
   this.description = attrs.description || '';
 }
开发者ID:mzolkiewski,项目名称:ng2-cli-todos,代码行数:8,代码来源:todo.ts

示例7: newCharacter

  newCharacter() {
    let uuid = UUID.UUID()
    let c = new Character()
    c.id = uuid
    c.personal.name = "New Character"

    this._dbService.addCharacter(c)
    this.router.navigate(['/characters', c.id]);
  }
开发者ID:WTIGER001,项目名称:pfdr,代码行数:9,代码来源:pc-list.component.ts

示例8: addTask

    addTask(taskName: string, description: string = '') {
        this._tasks.push({
            id: UUID.UUID(),
            name: taskName,
            description: description,
            done: false
        });

        this._tasksObserver.next(this._tasks);
    }
开发者ID:Antowka,项目名称:angular2-todo,代码行数:10,代码来源:TasksService.ts

示例9: LoggerActionLogModel

    this.storage.get('loginProfile').then(profile => {

      // actionLog Model
      let actionLog = new LoggerActionLogModel();
      actionLog.agentid = profile.agentid;
      actionLog.page = this.page;
      actionLog.object = this.object;
      actionLog.type = this.type;
      actionLog.seq = UUID.UUID()

      // call log
      this.logger.insertActionLog(actionLog);
    });
开发者ID:warozz,项目名称:D3VMobiz,代码行数:13,代码来源:log.ts

示例10: constructor

  constructor(private navController: NavController, 
              private lobbyService: LobbyService,
              private drawingService: DrawingService) {

                var debug = false;
    if(debug)
    {
      this.lobbyService.login(UUID.UUID());
      return;
    }

    if(lobbyService.currentUser == null) {
        let modal = Modal.create(LoginModalComponent);
        this.navController.present(modal);
    }

  }
开发者ID:lucarin91,项目名称:dwyw-talk,代码行数:17,代码来源:home.ts


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