property name not working in typescript as expected

I am following a course on Udemy where the instructor has the code as following: upload(bookId: number) { this.makeFileRequest("http://localhost:8181/book/add/image?id="+bookId, [], this.filesToUpload).then((result) => { console.log(result); }, (error) => { console.log(error); }); } fileChangeEvent(fileInput: any) { this.filesToUpload = <Array<File>> fileInput.target.files; } makeFileRequest(url:string, params:Array<string>, files:Array<File>) { return new Promise((resolve, reject) => { var formData:any = new FormData(); var […]

By WannaBeDev
Published
Categorized as angular, javascript, typescript Tagged , ,

logout function refreshes the page but it’s still logged in

I am following a course on Udemy, the instructor’s side is using Angular 2 and I am trying to build the app using the latest version. The main problem I have, is that the logout function is accessed but because I have to refresh the page to display the login form again, for some reason, […]

subscribe function always going on error observer

I am following a course on Udemy which uses Angular 2.0 and I’m trying to build it using the latest version. My problem occurs in this function : checkSession() { const url = ‘http://localhost:8181/checkSession’; const xToken = localStorage.getItem(‘xAuthToken’); const basicHeader = ‘Basic ‘ + localStorage.getItem(‘credentials’); const headers = new HttpHeaders({ ‘x-auth-token’ : JSON.stringify(xToken), ‘Authorization’ : […]

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq