import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Injectable({ providedIn: 'root', }) export class MessageService { constructor(private http: HttpClient) {} sendMessage(message: string) { return this.http.post('http://localhost:5005/webhooks/rest/webhook', { message: message }); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter