本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
});
示例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");
}
}
示例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); }
}
}
示例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;
}
示例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;
}
示例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;
});
}
示例10: onViewClick
onViewClick(){
if ( isUndefined(this.students)){
this.studentDataService.getStudentsData()
.subscribe(students => this.students = students);
}
}