File

src/app/chats/chats.service.ts

Index

Properties
Methods

Constructor

constructor(_http: HttpClient)
Parameters :
Name Type Optional
_http HttpClient No

Methods

createChat
createChat(chat)
Parameters :
Name Optional
chat No
Returns : void
getChatsList
getChatsList()
Returns : any
updateChatMessage
updateChatMessage(key: string, value: any)
Parameters :
Name Type Optional
key string No
value any No
Returns : void

Properties

Private apiUrl
Type : string
Default value : '/assets/data/chats'
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable()
export class ChatsService {
  private apiUrl = '/assets/data/chats';

  constructor(private _http: HttpClient) {}

  getChatsList() {
    const url = `${this.apiUrl}/list.json`;
    return this._http.get(url);
  }

  createChat(chat) {}

  updateChatMessage(key: string, value: any) {}
}

result-matching ""

    No results matching ""