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


TypeScript util.isUndefined函數代碼示例

本文整理匯總了TypeScript中util.isUndefined函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isUndefined函數的具體用法?TypeScript isUndefined怎麽用?TypeScript isUndefined使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了isUndefined函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getErrMsg

  public getErrMsg() {
      var errMsg = null;

      if( errMsg==null && false===isUndefined(this.details) ) {
        errMsg = this.details;
      }
      if( errMsg==null && false===isUndefined(this.message) ) {
        errMsg = this.message;
      }

      return errMsg;
  }
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:12,代碼來源:preparation-alert.util.ts

示例2: constructor

 constructor(label: string, disabled?: boolean, isChecked?: boolean, subLevelChecklist?: ChecklistModel, value?: any) {
     this.label = label;
     this.disabled = disabled;
     this.isChecked = isChecked;
     this.value = isUndefined(value) ? label : value;
     this.subLevelChecklist = subLevelChecklist;
 }
開發者ID:onap-sdc,項目名稱:sdc-ui,代碼行數:7,代碼來源:ChecklistItem.ts

示例3: constructor

 constructor(hostname : string, port : number, secure : boolean) {
     if (!port || !hostname || isUndefined(secure)) {
         error('ServerLocation object creation failed. Arguments should not be undefined')
     }
     this.port = port;
     this.secure = secure;
     this.hostname = hostname;
 }
開發者ID:AndrienkoAleksandr,項目名稱:che,代碼行數:8,代碼來源:server-location.ts

示例4:

 .catch((error) => {
   if (true !== isUndefined(error.code) && error.code === 'PR5102') {
     Loading.hide();
     PreparationAlert.success(this.translateService.instant(error.details));
     popupService.notiPopup({ name: 'update-dataflow', data: null });
     return Promise.reject(null);
   }
   throw error;
 });
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:9,代碼來源:dataflow.service.ts

示例5: loadConfiguration

export function loadConfiguration(): IConfiguration {
  if (fs.existsSync(cfgFile)) {
    try {
      const obj = yaml.safeLoad(fs.readFileSync(cfgFile, 'utf8')) as any;
      const cfg = obj['clubhouse-cli'] as IConfiguration;
      if (isUndefined(cfg)) return makeError("Error loading configuration");
      return cfg;
    } catch (e) {
      return makeError(e.message);
    }
  } else {
    return makeError("Configuration file not found");
  }
}
開發者ID:tyrchen,項目名稱:clubhouse-cli,代碼行數:14,代碼來源:configuration.ts

示例6: output

 public static output(error:any, message?:any): void {
   if( error.code && true===error.code.startsWith("PR") ) {
     var category = error.code.charAt(2);
     var details = error.details;
     switch(category) {
       case '0':
         Alert.success(details ? details : message);
         break;
       case '1':
         Alert.warning(details ? details : message);
         break;
       case '5':
       case '6':
       case '7':
       default:
         if(!isUndefined(details)) { Alert.errorDetail(message, details); } else { Alert.error(message); }
         break;
     }
   } else {
     console.error(error);
     if(!isUndefined(error.details)) { Alert.errorDetail(message, error.details); } else { Alert.error(message); }
   }
 }
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:23,代碼來源:preparation-alert.util.ts

示例7: rePasswordValidation

 /**
  * 새로운 패스워드 확인 validation
  */
 public rePasswordValidation(): void {
   // 비밀번호가 비어 있다면
   if (isUndefined(this.rePassword) || this.rePassword === '') {
     this.resultRePassword = false;
     this.rePasswordMessage = this.translateService.instant('msg.comm.alert.profile.password.re.empty');
     return;
   }
   // 비밀번호가 일치하지 않을 때
   if (this.newPassword !== this.rePassword) {
     this.resultRePassword = false;
     this.rePasswordMessage = this.translateService.instant('msg.comm.alert.profile.password.re.match.not');
     return;
   }
   this.resultRePassword = true;
   return;
 }
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:19,代碼來源:change-password.component.ts

示例8: newPasswordValidation

 /**
  * 새로운 패스워드 validation
  */
 public newPasswordValidation(): void {
   // 비밀번호가 비어 있다면
   if (isUndefined(this.newPassword) || this.newPassword === '') {
     this.resultNewPassword = false;
     this.newPasswordMessage = this.translateService.instant('msg.comm.alert.profile.password.new.empty');
     return;
   }
   // 패스워드 확인
   if (!StringUtil.isPassword(this.newPassword)) {
     this.resultNewPassword = false;
     this.newPasswordMessage = this.translateService.instant('msg.comm.alert.profile.password.new.match.not');
     return;
   }
   this.resultNewPassword = true;
   return;
 }
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:19,代碼來源:change-password.component.ts

示例9: passwordValidation

 /**
  * 현재 패스워드 validation
  */
 public passwordValidation(): void {
   // 비밀번호가 비어 있다면
   if (isUndefined(this.password) || this.password === '') {
     this.resultPassword = false;
     this.passwordMessage = this.translateService.instant('msg.comm.alert.profile.password.empty');
     return;
   }
   // 비밀번호 체크
   this.userService.checkUserPassword(this._userId, this.password)
     .then((result) => {
       if (result['matched'] === true) {
         this.resultPassword = true;
       } else {
         this.resultPassword = false;
         this.passwordMessage = this.translateService.instant('msg.comm.alert.profile.password.match.not');
       }
     })
     .catch((error) => {
       this.resultPassword = false;
     });
 }
開發者ID:bchin22,項目名稱:metatron-discovery,代碼行數:24,代碼來源:change-password.component.ts

示例10: onViewClick

 onViewClick(){
   if ( isUndefined(this.students)){
     this.studentDataService.getStudentsData()
       .subscribe(students => this.students = students);
   }
 }
開發者ID:chartchai,項目名稱:SE331-lab12,代碼行數:6,代碼來源:menu.component.ts


注:本文中的util.isUndefined函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。