本文整理汇总了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!');
}
}
示例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!');
}
}
示例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)
}
示例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!');
}
}