1

I've been developing a simple app in Ionic 2 and I tried using mock service (in-memory web API) for fetching data as described in this Angular 2 tutorial. My console reported this error:

TypeScript error: app/app.ts(11,49): Error TS2307: Cannot find module 'angular2-in-memory-web-api'.

I tried this solution: angular2-in-memory-web-api 404 error. After running this: npm i angular2-in-memory-web-api --save, I was unable to find the files where I was supposed to use the code provided in the rest of the solution.

How can I fix this? Sorry if the question is not posed quite right, this is my first one. Please ask if any additional information is needed. The problem is pretty much the same as the one for which the solution was provided in the link above, except that using Ionic 2 makes the given solution inapplicable in my case. I'm don't think SystemJS is being used, please see my file structure image.

Image of my file structure.

6
  • Are you using SystemJS? In that case you need to map in SystemJS config as the other files. Commented Aug 9, 2016 at 19:30
  • I don't think so... I've appended the image of my file structure, it should provide an overview over what is being used, at least a partial one. I just followed the installation instructions on the framework's website, I didn't really do all the files myself. Commented Aug 9, 2016 at 19:56
  • How's your SystemJS config looks? Commented Aug 9, 2016 at 20:09
  • I don't know, I can't find it if I even have it. If I could find it, then I could implement the previous solution. Commented Aug 9, 2016 at 21:06
  • It seems that Ionic 2 doesn't use SystemJS by default. It is not defined in the package.json, I just checked. Commented Aug 9, 2016 at 21:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.