当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ToastsManager.info方法代码示例

本文整理汇总了TypeScript中ng2-toastr.ToastsManager.info方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ToastsManager.info方法的具体用法?TypeScript ToastsManager.info怎么用?TypeScript ToastsManager.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ng2-toastr.ToastsManager的用法示例。


在下文中一共展示了ToastsManager.info方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: saveEmergency

 saveEmergency() {
   if (this.formEmergency.valid) {
     if (this.patients.length > 0) {
       const emergency = {
         date: this.formEmergency.get('date').value,
         type_emergency: this.formEmergency.get('category').value,
         driver: this.driverSelected,
         ambulance: this.ambulanceSelected,
         paramedic: this.paramedicsSelected,
         patient: this.patients,
         location: {
           type: 'Point',
           coordinates: this.positions
         }
       };
       this.formEmergency.reset({
         driver: '',
         ambulance: '',
         paramedics: ''
       });
       this._emergencyService.save(emergency).subscribe(
         (res) => {
           console.log(res.json());
         },
         (error) => {
           console.log(error.json());
         }
       );
     }else{
       this._toast.info('Debe ingresar al menos un paciente', 'Emergencias!');
     }
   }else{
     this._toast.info('Todos los campos marcados con * son obligatorios', 'Emergencias!');
   }
 }
开发者ID:manuelao-s4ds,项目名称:Emergencies-ui,代码行数:35,代码来源:emergency.component.ts

示例2: saveAmbulance

 saveAmbulance() {
   if (this.formAmbulance.valid) {
     const ambulance = {
       car: this.formAmbulance.get('car').value,
       car_plate: this.formAmbulance.get('car_plate').value,
       type_ambulance: this.formAmbulance.get('type_ambulance').value,
       available: this.formAmbulance.get('available').value
     };
     this.formAmbulance.reset({
       car: '',
       car_plate: '',
       type_ambulance: '',
       available: ''
     });
     this._ambulanceService.save(ambulance).subscribe(
       (res) => {
         console.log(res.json());
       },
       (error) => {
         console.log(error.json());
       }
     );
   }else {
     this._toast.info('Todos los campos marcados con * son obligatorios', 'Ambulancias!');
   }
 }
开发者ID:manuelao-s4ds,项目名称:Emergencies-ui,代码行数:26,代码来源:ambulances.component.ts

示例3: toastInfo

  /*
   * Displays an info message
   */
  toastInfo(reason?: string)
  {
    let message: string;
    let key: string;

    switch(reason)
    {
      case 'jobRegistered':
        key = 'TOASTR.INFO.JOB';
        break;
      case 'noResult':
        key = 'TOASTR.INFO.NORESULT';
        break;
      case'restartNeeded':
        key = 'TOASTR.INFO.RESTART';
        break;
      default:
        key = 'TOASTR.INFO.DEFAULT';
        break;
    }

    this.translateService.get(key).subscribe(
      value => {
        message = value;
      });

    this.toastr.info(message)
  }
开发者ID:jodogne,项目名称:orthanc-explorer-2,代码行数:31,代码来源:app.component.ts

示例4: save

  save() {
    if (this.formParamedics.valid) {
      const paramedic = {
        name: this.formParamedics.get('name').value,
        lastname: this.formParamedics.get('lastname').value,
        phone: this.formParamedics.get('phone').value,
        cellPhone: this.formParamedics.get('cellPhone').value,
        gender: this.formParamedics.get('gender').value,
        birthdate: this.formParamedics.get('birthdate').value,
        specialization: this.formParamedics.get('specialization').value
      };
      this._paramedicsService.save(paramedic).subscribe(
        (res) => {
          this._toast.success(`Se registro el paramedico ${res.json().name}`, 'Paramedicos!');
          this.formParamedics.reset({
            gender: ''
          })
        },
        (error) => {
          console.log(error.json());
          this._toast.error(`Ocurrio un error al registrar al paramedico`, 'Paramedicos!');
        }
      );
    }else {
      this._toast.info(`Todos los campos marcados con * son obligatorios`, 'Paramedicos!');

    }
  }
开发者ID:manuelao-s4ds,项目名称:Emergencies-ui,代码行数:28,代码来源:paramedics.component.ts


注:本文中的ng2-toastr.ToastsManager.info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。