bom dia, o get esta dando erro na hora que vou definir a url
constructor(){
this._http = new HttpService();
}
static testWithAjax() {
return new Promise((resolve, reject) => {
this._http
.get('https://reqres.in/api/users/2')
.then(form => {
document.querySelector('#nameTwo').innerHTML = `${form.id}`
})
});
}
erro no console
Uncaught (in promise) TypeError: Cannot read property 'get' of undefined
get(url){
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = () => {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
resolve(JSON.parse(xhr.responseText).data);
}
}
}
xhr.send();
});
}