本文整理汇总了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);
}
}
}
}
});
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:28,代码来源:form.service.ts
示例2: getHl7
getHl7(){
if(_.hasIn(this.mainservice.global,'hl7')){
return Observable.of(this.mainservice.global.hl7);
}else{
return this.hl7service.getHl7ApplicationsList('');
}
}
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:7,代码来源:dynamic-field.service.ts
示例3: getAets
getAets(){
if(_.hasIn(this.mainservice.global,'aes')){
return Observable.of(this.mainservice.global.aes);
}else{
return this.aeListService.getAes();
}
}
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:7,代码来源:dynamic-field.service.ts
示例4: getDevice
getDevice(){
if(_.hasIn(this.mainservice.global,'devices')){
return Observable.of(this.mainservice.global.devices);
}else{
return this.deviceService.getDevices();
}
}
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:7,代码来源:dynamic-field.service.ts
示例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");
}
});
}
}
开发者ID:PyJava1984,项目名称:dcm4chee-arc-light,代码行数:9,代码来源:devices.service.ts
示例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");
}
});
}
}
开发者ID:PyJava1984,项目名称:dcm4chee-arc-light,代码行数:9,代码来源:devices.service.ts
示例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);
}
}
开发者ID:PyJava1984,项目名称:dcm4chee-arc-light,代码行数:20,代码来源:placeholderchanger.directive.ts
示例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);
}
}
}
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:21,代码来源:placeholderchanger.directive.ts
示例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'
});
}
}
开发者ID:PyJava1984,项目名称:dcm4chee-arc-light,代码行数:40,代码来源:http-error-handler.ts
示例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'
});
}
}
开发者ID:dhanzhang,项目名称:dcm4chee-arc-light,代码行数:53,代码来源:http-error-handler.ts
注:本文中的lodash.hasIn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论