當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angular2-uuid.UUID類代碼示例

本文整理匯總了TypeScript中angular2-uuid.UUID的典型用法代碼示例。如果您正苦於以下問題:TypeScript UUID類的具體用法?TypeScript UUID怎麽用?TypeScript 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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。