-1
js에서 http.get 함수를 worte하지만 Angular2의 Typescript에 있어야합니다. 너 나 좀 도와 줄 수있어? 지도가 포함되어 있다고 생각하지만 기능을 반환할지 모르겠습니다.angular2에 http.get을 올바르게 작성하는 방법
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
@Injectable()
export class UrlExists {
constructor(
public http: Http
) {
}
newF(url) {
this.http
.get(url)
.success(function() {
return true;
})
.error(function() {
return false;
});
};
}
감사합니다. 간단하고 명확한 대답을하는 것이 좋습니다. 당신의 도움을 주셔서 감사합니다. – Louis