Angularda xizmat yaratish uchun siz TypeScript sinfini yaratishingiz va uni Angular tomonidan taqdim etilgan @Injectable (() dekoratori yordamida xizmat sifatida saqlashingiz mumkin. Masalan, xabarlarni saqlash uchun siz quyidagilarni yozishingiz mumkin: import { Injectable } from '@angular/core'; @Injectable) export class MessageService { messages: string[] = []; add(message: string) { this.messages.push(message); } clear) { this.messages = []; } } Xizmat yaratilgandan so'ng, siz uni komponentlarda ishlatishingiz mumkin, uni ularning konstruktorida joylashtirishingiz mumkin. Masalan: { Component from @angular/core/; Message import { Service from./message.service; @Component selector: app; { Url-message template: 
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence