0
이 의사 코드를 작동시키는 방법이 있습니까?Angular2 구독 내에서 약속을 해결 하시겠습니까?
private letsSee(): Promise<any> {
return new Promise(resolve => {
this.someService.someValue.subscribe((nextValue) => {
resolve(nextValue);
});
});
}
이 코드 (즉, 모든 의사 없음) 작동하지 않을 어떤 이유가 있습니까? 오류가 있습니까? – Bergi
그래서 다시 시도했지만, 위의 코드를 다음과 같이 수정 한 후에도 'this.letsSee(). then (res => {console.log (res)}); 'resolve (true)' –
괜찮음 = D가 실수를 발견했습니다. 물론 작동합니다. –