I find myself reusing generic functions and I'd much rather have them in one place and simply import them into my various components. Is that something I can do easily in Angular 2?
For example:
handleResponse(message) {
let toast = this.toastCtrl.create({
message: message,
duration: 3000,
position: 'top'
});
toast.present();
}
Where would I put it in order to be able to import this function and call it?