Topic: Using Angular 2+ with wialon remote api
Hello, i want to use wialon remote API from angular http client, but i get the error "from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
this is my code:
import { Component } from '@angular/core';
import 'rxjs/add/operator/map';
import {Http,Response} from "@angular/http";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
private apiUrl ='https://hst-api.wialon.com./wialon/ajax.html?svc=token/login' +
'¶ms={"token":"5dce19710a5e26ab8b7b8986cb3c49e58C291791B7F0A7AEB8AFBFCEED7DC03BC48FF5F8"';
data: any={};
params:String='} }'
constructor(private http:Http){
this.getData();
this.getUser();
}
getData(){
return this.http.get(this.apiUrl+this.params).map((res:Response)=>res.json());
}
getUser(){
this.getData().subscribe(data=> {
console.log(data);
this.data=data;
})
}
}
else are there other languages to develop my front end using sdk api
Thank you