57 questions
1
vote
0
answers
126
views
Issues HttpClientInMemoryWebApiModule in Angular Standalone
I'm trying to use HttpClientInMemoryWebApiModule in an Angular V 18.2.11 standalone application and I'm encountering this error:
ERROR Error [NullInjectorError]: R3InjectorError(Standalone[...
0
votes
1
answer
1k
views
After migrating to Angular 18 with the new build system I got an error: Http failure during parsing
I have updated a project that I use as a library for my application from angular 17 to angular 18, and I have updated all the packages as usual. I have also accepted the migration to the new build ...
1
vote
0
answers
68
views
how do I fix a 404 error when my Angular HttpClient can't find the API endpoint for retrieving
HttpClient can't find API endpoint: 404 Error when retrieving Pokémon data.
I'm using Angular's HttpClient module to fetch Pokémon data through a service. Here's my code for retrieving a single ...
2
votes
1
answer
78
views
How to configure in-memory-web-api in Angular to accommodate route parameters
I am trying to get my data service to accommodate route parameters.
@Injectable({
providedIn: 'root'
})
export class DataService implements InMemoryDbService {
createDb(): {
...
0
votes
1
answer
144
views
InMemoryWebAPI does not return JSON data
I am tackling the Tour of Heroes tutorial in Angular. The problem I am facing is with InMemoryWebAPI setup. The files involved are the following:
in-memory-data.service.ts
import { Injectable } from '@...
2
votes
2
answers
2k
views
Angular 17 in-memory-web-api cannot find the route to the in-memory data?
I am new to Angular. I followed the Tour of Hero tutorial to the step of using httpClient to retrieve data from the in-memory-web-api. I got an error of 'Unexpected token '<', "<!DOCTYPE &...
0
votes
0
answers
179
views
Failing to run an existing project
I am starting with section 6 of Google's Tour of Heroes : "Get data from a server".
It seems that messages said I succeeded with installing InMemoryDataService and ...
12
votes
1
answer
2k
views
Anyone try using InMemoryWebAPI with standalone components?
I am using Angular v16 with standalone components. I implemented InMemoryWebAPI as I have in NgModule-based projects, but it doesn't seem to be working. I keep getting 404 not found.
Anyone try this ...
0
votes
1
answer
308
views
My angular app doesn't fetch data from the in-memory web api anymore
I'm building a project I have to submit today and it was fine, that's it could fetch data from the in-memory web api through the http.get() and display in the table in the data component and also when ...
-1
votes
1
answer
91
views
how to fix In-Memory Angular display error 404
I watched all the videos about the In-memory web API and I followed all the steps and instruction but I still have a 404 Error. Please Let me know If I missed something.
I've been tried to fix this ...
0
votes
1
answer
133
views
Why In-memory-web-api does not generate an ID?
I'm trying to use InMemoryDbService to simulate an API and make http requests with it. My GET,PUT and DELETE methods work but my CREATE method does not. Looks like the ID is not generated in the route ...
1
vote
1
answer
754
views
Tour of Heroes tutorial error 404 with "angular-in-memory-web-api"
I followed the angular toh tutorial (literally copy pasted) and i'm now on part 6 at the step :
Refresh the browser. The hero data should successfully load from the mock server.
However it doesn't ...
5
votes
2
answers
4k
views
Trying to npm install angular-in-memory-web-api and I'm getting errors
npm i angular-in-memory-web-api --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/...
-2
votes
1
answer
444
views
Angular with in memory data service: api/"something" not found
I am trying to use InMemoryDbService as data source in Angular 14.0.2 (/Node 16.15.1) project.
I'm getting "api/[something]" not found in the browser log, no other apparent error.
I can't ...
-2
votes
1
answer
96
views
Angular In-Memory Web API with Embedded
I'm trying to use Angular In-Memory Web API. I have many API that are used as CRUD but the issue is that I have responses with embedded and pagination.
Here is an example of one of my CRUD:
readPage(...
3
votes
0
answers
260
views
Angular In Memory Web API - How to change priority to HTTP Local server then In memory web API
I am working with Angular In Memory Web API for making API calls locally without actual RESTful APIs from my Java application. I created the URLs in In memory Data service as same like LIVE RESTful ...
0
votes
1
answer
558
views
Error: Collection not found , while using in-memory-web-api (not using any live api or json data )
i am trying to create dummy login from inmemory db angular without using any json file or live api
for in memory service i am using users object
const users = [
{ id: 1, userName: 'abhijeet', ...
1
vote
2
answers
2k
views
Angular TypeScript Date.getFullYear() not a function when returning Observable from server
I am attempting to display data like so:
<a *ngFor="let month of months">
<div>
<h4>{{month.name + month.date.getFullYear()}}</h4>
<p *...
2
votes
1
answer
536
views
Angular-in-memory-web-api PUT returns null
I created this basic data service for todos:
import { InMemoryDbService } from 'angular-in-memory-web-api';
import { Todo } from './todos.service';
export class TodosData implements InMemoryDbService ...
0
votes
1
answer
1k
views
How can we change angular-in-memory-web base url
I am new to angular and I was referring standard angular material present on angular site for the tutorial and I come upon part "Get Data from server". In this, I have created my in-memory ...
0
votes
1
answer
72
views
how to post with InMemoryWebApi for Angular?
I have mock data to which I want to add values. In particular there is a users object and each user has a rating property which is an array of numbers from 1 to 5. I would like to add further values ...
-2
votes
2
answers
723
views
Running Angular project shows error as angular-in-memory-web-api
My observerable and subscribe class looks like below
Observable
Subscribe
Error
2
votes
1
answer
688
views
genId() method in "Angular-in-memory-web-api"
I'm doing the Angular Tour of heroes tutorial, but there is somethings I don't understand, I did some google reasearch but I don't find out an explanation. I don't know where I could ask question. So,...
0
votes
1
answer
97
views
InMemoryWebApi parsing OData URL with key
For the life of me I cannot get InMemoryWebApiModule to work for me with a moderately simple custom URL parser (specifically for OData).
This is my module configuration:
InMemoryWebApiModule.forRoot(...
0
votes
2
answers
2k
views
How can I inject a parameter from a component to a service in Angular?
Greetings,
While I was following the Tour of Heroes guide, I wanted to experiment a little with having multiple data array options and with which heroesUrl I use to ask for data from the ...
1
vote
0
answers
182
views
Angular in memory db
I'm currently using in-memory-db package (angular-in-memory-web-api) and I'm not be able to make requests like:
api/products/authors --> doesn't work
I should stop at products path, Indeed:
api/...
1
vote
1
answer
398
views
Error 404 Url Not Found when using InMemoryDbService in Angular
I'm doing a web application in Angular 8.3.21. I'm trying to implemente a fake backend using InMemoryDbService to test my http requests. I'm also using faker to create random id's and words.
I have ...
1
vote
1
answer
176
views
how to exclude a service from HttpClientInMemoryWebApiModule angular?
I have HttpClientInMemoryWebApiModule already configured on my angular application. I want to exclude a service, so I can test it without adding the base url in the first:
Problem:
app.module.ts :
...
2
votes
0
answers
289
views
How to use angular-in-memory-web-api only for some APIs?
I use in-memory-web-api like this:
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule,
environment.production ?
[] : HttpClientInMemoryWebApiModule.forRoot(...
1
vote
0
answers
731
views
"Collection id type is non-numeric or unknown. Can only generate numeric ids."
public createOEInputParameters(param: OeinputParameters) {
const url = `${this.apiUrl}`;
return this.http.post(url, JSON.stringify( param), httpOptions).pipe(map(this.serviceHelper....
1
vote
4
answers
2k
views
Angular: Issue in adding dynamically generated input field data on the (change) event
I have a feature where I need to send dynamically generated input fields on button click.
I have recreated the problem on stackblitz for better understanding.
In that app, when I enter ...
2
votes
1
answer
2k
views
Error when adding query params to http request
I am using mock data and InMemoryDbService as shown on the tour of heroes example. Loading data works fine when I don't pass HttpParams. Once I add params, I get a 500 response with the following ...
0
votes
0
answers
540
views
npm shows error when to install `angular-in-memory-web-api`
I am new to Angular. I was going through Angular 7 official documents and tried to install angular-in-memory-web-api using npm. But it shows the following error.
Command:
npm install angular-in-...
1
vote
0
answers
150
views
Parse data into in-memory-web-api in Angular 7
I'm looking to pull in data from an XML file and use that as the starting values for my in-memory web API in Angular 7:
My app.module.ts
import { BrowserModule } from '@angular/platform-browser';
...
1
vote
1
answer
281
views
Read data from .json/.xml and populate a list in Angular
I'm setting up a CRUD App in Angular as part of my learning curriculum,and wand to populate my list from a file(that will accept .json /.xml format).I've managed to read from file and print in ...
0
votes
3
answers
2k
views
Instance variable not assigned in Observable<> subscribe?
My games array is not being assigned when subscribing from Obersavable for some reason even though I for sure get the correct data (array) back from the server.
Here is my game.service.ts:
import { ...
2
votes
2
answers
896
views
Is it possible to pass in more than one ID to a query string in angular-in-memory-web-api?
For example, I want do something like this:
{hostURL}/api/entities/14/15/16/17
which in turn would bring back all the data for the corresponding IDs. This approach doesn't work. I also tried this, ...
0
votes
2
answers
794
views
HttpInterceptor and In memory data service Angular 7
I have been using a dummy auth for an app I am working on. So I have implemented this successfully using a dummy local user.
Unfortunately I have hit a brick wall when it comes to trying to get this ...
0
votes
1
answer
799
views
Problem with HttpClientInMemoryWebAPI in Tour of Heroes
I've been doing the Tour of Heroes tutorials again since I'm coming off of a 4 month hiatus from Angular. Everything was going fine until I hit the http section. Specifically the HttpClientInMemoryAPI ...
0
votes
0
answers
74
views
Extending angular-in-memory-web-api
My org returns the same object for any api.
This is a wrapper around the actual normal response you would expect from a restful api
e.g.
api/products returns MyOrgResponse object which might look ...
3
votes
1
answer
388
views
angular in-memory-web-api simple query string not working with @ character
I am using Angular2+ with in-memory-web-api and I am trying to do a simple query string. I am passing an exact email address to check if the user already exists. My createDB has a couple users with a ...
2
votes
1
answer
1k
views
Can't get angular-in-memory-web-api 0.6.1 to work following the tutorial
So I've followed the tutorial from https://angular.io/tutorial/toh-pt6 . I've tailored the tutorial to my specific case, which is just displaying a dashboard. When I use a local mock my code works ...
0
votes
1
answer
1k
views
angular tour of heroes - step 8/HTTP - in-memory webapi returning undefined
Problem: in-memory web api would return 'undefined' when trying to get all heroes by using HeroService.getHeroes() as described in step 8 of the tutorial.
InMemoryDataService implementation:
import {...
1
vote
1
answer
793
views
How to use in-memory-web-api and real service API in Angular5 application
I am facing issue when am using in-memory-web-api with real api. when i am calling post call its not triggering it's looking in in-memory-web-api. I want to use in-memory-web-api for some pages ...
0
votes
1
answer
91
views
Iterating about values of an object array property
I use the Angular InMemoryService to store some fake data. I would like to transform the "HashtagDB" property into the array "hashtags". This "hashtags" array should only contain the values, but not ...
3
votes
1
answer
1k
views
angular how to use in-memory-web-api only for demo account
I have found a lot of resources on how to switch between using angular-in-memory-web-api or real API depending on the environment (dev or prod) but what I'm trying to do is quite different.
I want ...
1
vote
2
answers
1k
views
Angular Tour of Heroes and In Memory Data Service
I'm currently going through the Angular.io tour of heroes tutorial, making some really minor changes as I go along so I'm not 100% copying the tutorial.
I've reached section six on http, more ...
2
votes
1
answer
408
views
Nested in-memory-web-api i.e. longer uri
I'm trying to develop an application using in-memory-web-api, however, I'm not sure how to deal with longer URI patterns.
For example, I need to fetch some configuration data from the server using /...
1
vote
2
answers
1k
views
id should be optional in angular-in-memory-web-api
According to read me for angular-in-memory-web api 'The in-memory web api library currently assumes that every collection has a primary key called id'
Is there any option to have no id? as I would ...
1
vote
1
answer
412
views
Angular In-memory-web-api not finding individual objects throws 404
I have an angular app which i am using the in-memory-web-api to mock up some http calls to a REST api that is not yet up and running.
I am trying to get some Podcast objects by hitting the following ...