本文整理汇总了TypeScript中lodash.hasIn函数的典型用法代码示例。如果您正苦于以下问题:TypeScript hasIn函数的具体用法?TypeScript hasIn怎么用?TypeScript hasIn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hasIn函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
_.forEach(element['validation'], (m, i) => {
switch (i){
case 'minimum':
validationArray.push(CustomValidatorDirective.min(m));
break;
case 'maximum':
validationArray.push(CustomValidatorDirective.max(m));
break;
case 'pattern':
validationArray.push(CustomValidatorDirective.regExp(m));
break;
default:
if (i === 'required' && m === true){
validationArray.push(Validators.required);
if (_.hasIn(element, 'validation.required') && element['validation'].required){
if (_.hasIn(element, 'options')){
if (element['controlType'] === 'checkbox' || element['controlType'] === 'arrayelement'){
validationArray.push(CustomValidatorDirective.requiredArray(element['options']));
}else{
validationArray.push(CustomValidatorDirective.required(element['options']));
}
}else{
validationArray.push(Validators.required);
}
}
}
}
});
示例2: getHl7
getHl7(){
if(_.hasIn(this.mainservice.global,'hl7')){
return Observable.of(this.mainservice.global.hl7);
}else{
return this.hl7service.getHl7ApplicationsList('');
}
}
示例3: getAets
getAets(){
if(_.hasIn(this.mainservice.global,'aes')){
return Observable.of(this.mainservice.global.aes);
}else{
return this.aeListService.getAes();
}
}
示例4: getDevice
getDevice(){
if(_.hasIn(this.mainservice.global,'devices')){
return Observable.of(this.mainservice.global.devices);
}else{
return this.deviceService.getDevices();
}
}
示例5: changeHl7ApplicationNameOnClone
changeHl7ApplicationNameOnClone(device,hl7){
if (_.hasIn(device, 'dcmDevice.hl7Application') && _.size(device.dcmDevice.hl7Application) > 0){
_.forEach(device.dcmDevice.hl7Application, (m, i) => {
if (_.hasIn(m, 'hl7ApplicationName')){
m.hl7ApplicationName = this.generateNewTitle(m.hl7ApplicationName, hl7, "hl7ApplicationName");
}
});
}
}
示例6: changeAetOnClone
changeAetOnClone(device,aes){
if (_.hasIn(device, 'dicomNetworkAE') && _.size(device.dicomNetworkAE) > 0){
_.forEach(device.dicomNetworkAE, (m, i) => {
if (_.hasIn(m, 'dicomAETitle')){
m.dicomAETitle = this.generateNewTitle(m.dicomAETitle, aes, "dicomAETitle");
}
});
}
}
示例7: ngOnInit
ngOnInit() {
console.log('start', this.inputAttribut);
console.log('mode', this.inputAttribut.mode);
console.log('iod', this.inputAttribut.iod);
if ((this.inputAttribut.code in Globalvar.IODPLACEHOLDERS) && _.hasIn(Globalvar.IODPLACEHOLDERS[this.inputAttribut.code], this.inputAttribut.mode)){
if (Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].action === 'replace' && this.el.nativeElement.tagName === 'INPUT'){
this.renderer.setElementAttribute(this.el.nativeElement, 'placeholder', Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].placeholder);
this.renderer.setElementAttribute(this.el.nativeElement, 'title', Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].placeholder);
}
if (Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].action === 'disable'){
this.disableElement();
}
}else{
if (this.inputAttribut.iod && !_.hasIn(this.inputAttribut.iod, this.inputAttribut.code)){
this.disableElement();
}
this.renderer.setElementAttribute(this.el.nativeElement, 'placeholder', this.inputAttribut.name);
}
}
示例8: ngOnInit
ngOnInit() {
if(this.inputAttribut.code == '00100020' && this.inputAttribut.externalInternalAetMode == "external"){
this.renderer.setAttribute(this.el.nativeElement, 'placeholder', this.inputAttribut.name);
}else{
if ((this.inputAttribut.code in Globalvar.IODPLACEHOLDERS) && _.hasIn(Globalvar.IODPLACEHOLDERS[this.inputAttribut.code], this.inputAttribut.mode)){
if (Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].action === 'replace' && this.el.nativeElement.tagName === 'INPUT'){
this.renderer.setAttribute(this.el.nativeElement, 'placeholder', Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].placeholder);
this.renderer.setAttribute(this.el.nativeElement, 'title', Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].placeholder);
}
if (Globalvar.IODPLACEHOLDERS[this.inputAttribut.code][this.inputAttribut.mode].action === 'disable'){
this.disableElement();
}
}else{
if (this.inputAttribut.iod && !_.hasIn(this.inputAttribut.iod, this.inputAttribut.code)){
this.disableElement();
}
this.renderer.setAttribute(this.el.nativeElement, 'placeholder', this.inputAttribut.name);
}
}
}
示例9: handleError
public handleError(error){
if (error._body && error._body != '') {
try{
let msgObject = JSON.parse(error._body);
let msg = "Error";
if(_.hasIn(msgObject,"msa-3")){
msg = msgObject["msa-3"];
}
if(_.hasIn(msgObject,"err-8")){
msg = msgObject["err-8"];
}
if(_.hasIn(msgObject,"errorMessage")){
msg = msgObject["errorMessage"];
}
this.mainservice.setMessage({
'title': 'Error ' + error.status,
'text': msg,
'status': 'error'
});
}catch (e){
if(error.status === 0 && error.statusText === ""){
WindowRefService.nativeWindow.location = "/dcm4chee-arc/ui2/";
}else{
this.mainservice.setMessage({
'title': 'Error ' + error.status,
'text': error.statusText + '!',
'status': 'error',
'detailError': error._body
});
}
}
}else{
this.mainservice.setMessage({
'title': 'Error ' + error.status,
'text': error.statusText,
'status': 'error'
});
}
}
示例10: handleError
public handleError(error){
if ((error._body && error._body != '')|| _.hasIn(error,"message")) {
try{
let msg = "Error";
if(_.hasIn(error,"message")){
msg = error["message"];
}else{
let msgObject = JSON.parse(error._body);
if(_.hasIn(msgObject,"msa-3")){
msg = msgObject["msa-3"];
}
if(_.hasIn(msgObject,"err-8")){
msg = msgObject["err-8"];
}
if(_.hasIn(msgObject,"errorMessage")){
msg = msgObject["errorMessage"];
}
}
this.mainservice.setMessage({
'title': 'Error ' + (error.status||''),
'text': msg,
'status': 'error'
});
}catch (e){
if(error.status === 0 && error.statusText === ""){
console.error("About to reload the page, error=",error);
if(_.hasIn(error,"_body.target.__zone_symbol__xhrURL") && _.get(error,"_body.target.__zone_symbol__xhrURL") === "rs/realm"){
WindowRefService.nativeWindow.location = "/dcm4chee-arc/ui2/";
}else {
this.mainservice.setMessage({
'title': 'Error ' + (error.status||''),
'text': `Request didn't work (${_.get(error,"_body.target.__zone_symbol__xhrURL") || ''})`,
'status': 'error'
});
}
}else{
this.mainservice.setMessage({
'title': 'Error ' + error.status,
'text': error.statusText + '!',
'status': 'error',
'detailError': error._body
});
}
}
}else{
this.mainservice.setMessage({
'title': 'Error ' + error.status,
'text': error.statusText,
'status': 'error'
});
}
}