File

lib/common/src/modals-provider/base-toast-controller.service.ts

Index

Methods

Methods

Public Async failure
failure(message: string)
Parameters :
Name Type Optional
message string No
Returns : Promise<>
Public Async info
info(message: string)
Parameters :
Name Type Optional
message string No
Returns : Promise<>
Public Async present
present(config: ToastConfig)
Parameters :
Name Type Optional
config ToastConfig No
Returns : Promise<>
Public Async success
success(message: string)
Parameters :
Name Type Optional
message string No
Returns : Promise<>
import 	{ 	Injectable	}	from '@angular/core'


export interface ToastConfig {
	message	: string
	color?	: string 		//primary, secondary, tertiary, light, medium, dark, success, warning, danger
}

@Injectable()
export class RccToastController {

	public async present( config: ToastConfig): Promise<unknown> {
		const msg = "ModalProviderModule: missing ToastProvider, please provide alternative toastControllerClass extending RccToastController."
		console.warn(msg)
		throw msg
	}

	public async success (message: string): Promise<unknown>{
		return await this.present({message: message, color: 'success'})
	}

	public async failure (message: string): Promise<unknown>{
		return await this.present({message: message, color: 'warning'})
	}

	public async info (message: string): Promise<unknown>{
		return await this.present({message: message, color: 'info'})
	}
}



results matching ""

    No results matching ""