I am trying to get my data service to accommodate route parameters.
@Injectable({
providedIn: 'root'
})
export class DataService implements InMemoryDbService {
createDb(): {
products: IProducts[],
product: IProduct
} {
const products = ProductsData.products;
const product = ProductsData.product;
return { products, product };
}
}
When I'm executing a route like products/123 I want the system to get the product collection. I've tried different approaches using the environment file and the product collection within the products-data.ts file, but I'm not having any luck. Are there examples available? For that matter, how should the data service be configured to accommodate query strings?