0

I have copied the Angular2 tour of heroes project to my asp.net mvc project. Everything Ok but when I change a line in hero.service.ts also hero.service.js

private heroesUrl = 'app/heroes'; // URL to web API

to my controller/action and I break point there.

the Angular 2 http never reach my controller/action

Please help me solve this problem.

Thank.

4
  • If you publish a link to the plunker and also your controller code that might help. Commented Sep 11, 2016 at 4:26
  • Can you please share more code? usually if you are calling web api then your path must in this format - http.get("api/heros") where api controller name is herosController. Commented Sep 11, 2016 at 5:55
  • are they running on the same port? I've created a CustomRequestOptions class that overrides the baseUrl. Commented Sep 11, 2016 at 7:25
  • Do you know for sure client sends request actual to the server with heroesUrl? I ported "Tour of Heroes" tutorial to MVC Core: github.com/yfranz/angular2-heroes-with-mvc-core-net It may give you some ideas. Commented Nov 3, 2016 at 22:31

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.