Hello @abhisheksoni,
Would you be able to confirm which angular version and builder SDK version you are using?
Here is an example on how to fetch data using HttpClient
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-your-component',
templateUrl: './your-component.component.html',
styleUrls: ['./your-component.component.css']
})
export class YourComponent implements OnInit {
constructor(private http: HttpClient) { }
ngOnInit(): void {
this.fetchProducts();
}
fetchProducts() {
this.http.get<any>('your-api-url').subscribe(
(data) => {
// Assign the received data to your state
state.productList = data;
},
(error) => {
console.error('Error fetching products:', error);
}
);
}
}
You may also find help at the below links