22/11/2017 Development / java script

I preferr observable

getColaboradores(filters) {

return new Promise((resolve, reject) => {

this.http.get(this.urlApi + '/colaboradores', { params : { data : filters }})

.toPromise()

.then(response => {

this.dataColaboradores = response.json();

resolve();

});

});

in your controller 

constructor(private service: ColaboradorService) {}

service.getColaboradores().then(_=>  this.loading = false)

and Observable

getColaboradores(filters): Observable<any[]> {

return this.http.get(this.urlApi + '/colaboradores', { params : { data : filters }})

.map(response => {

return response.json();

});

}