我正在学习角度5,我一直在尝试使用.next方法添加data.service.ts尝试这个:
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable()
export class DataService {
private go = new BehaviorSubject<any>([' First Goal','Second Goal']);
newvar = this.go.asObservable();
constructor() { }
changeGoal(newvar){
this.newvar.next(this.go);
}
}
我收到了这个错误:“属性'下一个'在'Observable'类型上不存在”;
答案 0 :(得分:0)
使用go.next()代替this.newvar.next(),然后
id pic_endorsed_to (FKEY)
1 1
2 1
3 1
}