Мой сервис
**Assign to data:Group gives error in get function
Observable<Group>' is missing the following properties from type**
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { Group } from "../models/group.model";
@Injectable({
providedIn: 'root'
})
export class GroupService {
newGroup = new Group;
private groupListSource = new BehaviorSubject<Group>(this.newGroup);
public groupListValue: Observable<Group> = this.groupListSource.asObservable()
constructor() { }
set groupItems(**data: Group**) {
this.groupListSource.next(Object.assign({}, data));
}
get groupItems() {
return this.groupListValue;
}
}
Моя модель
export class Group {
groupId: string;
groupName: string;
}