Questions tagged [angular-tour-of-heroes]

The Tour of Heroes is the demo used by Angular to teach Fundamentals.

You can find the Tour of Heroes demo here,

29 questions
104
votes
29 answers

Angular2 Tutorial (Tour of Heroes): Cannot find module 'angular2-in-memory-web-api'

I have followed the Tutorial. After changing app/maint.ts in the Http chapter I get the error when starting the app via command line: app/main.ts(5,51): error TS2307: Cannot find module 'angular2-in-memory-web-api'. (Visual Studio Code gives me…
toni
  • 2,270
  • 3
  • 22
  • 27
3
votes
1 answer

Tour of Heroes tutorial issue with "angular-in-memory-web-api"

I am following Angular's Tour of Heroes tutorial. On the last part "HTTP", I get a blank page when adding "angular-in-memory-web-api". The terminal doesn't show any error message but I get this message on the browser's console: localhost/:17 Error:…
damores
  • 2,251
  • 2
  • 18
  • 31
2
votes
1 answer

angular-tour-of-heroes gives 404 for 'api/heroes"

Just started learning angular development. Following official angular doc from angular.io. Everything was working fine step by step till I reach https://angular.io/tutorial/toh-pt6 Added HttpClientInMemoryWebApiModule for mocking remote server, now…
c.sankhala
  • 850
  • 13
  • 27
2
votes
1 answer

Angular github pages path has duplicate app names

I tried to build and deploy angular-tou-of-heroes application to github, but always got duplicate app name in the path. Could anybody help me with this issue? My build command is ng build --prod --output-path docs --base-href…
2
votes
3 answers

Get Heroes in Tour of Heroes from a REST url in Angular 2

After the Angular 2 Tour of heroes tutorial, I found myself wondering how I would "get the heroes" if I were using a REST api. Given that I have an API running on http://localhost:7000/heroes that would return the "mock-heroes" list of JSON, what is…
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
1
vote
1 answer

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 load and i don't get any error when i run "ng…
1
vote
1 answer

Error "Cannot find module './in-memory-data.service'"

I am following the Angular Tutorial (Tour of Heroes) but I am unable to finish the 7'th Tutorial regarding HTTP which simulates a web API using angular-in-memory-web-api. Everything is exactly how it is given in the tutorial. Still, I am getting…
KilianMYS
  • 11
  • 1
1
vote
1 answer

Angular: Class with Array of Foreign Keys

I've built the class "meal" with two properties like in the tour of heroes tutorial from angular: export class Meal { id: number; name: string; } Now I want to declare a class like "Mealplan". Each Mealplan should contain five Objects of Meal,…
1
vote
1 answer

Does Angular Tour of Heroes make use of Angular Routing?

In the Tour of Heroes Part 0, it says Run the CLI command ng new and provide the name angular-tour-of-heroes, as shown here: ng new angular-tour-of-heroes However that prompts me for Would you like to add Angular routing? That tutorial doesn't…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
1
vote
1 answer

angularjs Tour of Heroes example, how to implement web API Server

I am new to Angular, I used to code with PHP and some JavaScript. So I read the Tour of Heroes sample code and still don't understand clearly the concept of HttpClient. Suppose I am going to prepare web API server using MongoDB and Node.js. How can…
roscoe_x
  • 609
  • 1
  • 9
  • 16
1
vote
1 answer

Angular Tour of Heroes - Testing project included but not working

I downloaded the Angular Tour of Heroes testing project here. I am getting the following errors right from the start. Any ideas? ERROR in Entry module not found: Error: Can't resolve 'C:\code\testing\src\test.ts' in 'C:\code\testing' ERROR in…
Rod
  • 14,529
  • 31
  • 118
  • 230
0
votes
1 answer

How to get the source codes of Tour of Heroes app and tutorial for Angular version 13?

How to get the source codes of Tour of Heroes app and tutorial for Angular version 13? https://angular.io/generated/zips/toh-pt6/toh-pt6.zip get the source codes of Tour of Heroes app and tutorial for Angular version 14.
albertkao9
  • 125
  • 8
0
votes
1 answer

Pairing or Connecting input and button elements with angular

I was following the tutorial Tour of Heroes. While adding a new hero they say You can use an element paired with an add button. Insert the following into the HeroesComponent template, after the heading:
0
votes
1 answer

Angular Tour of Heroes

I am currently learning angular using the angular tour of heroes. I am slightly getting the concepts by following the examples. I am now in adding a new hero. For those who finished the tutorial, I just have question. In the add hero, I can't get my…
0
votes
0 answers

What is the purpose of the sign "!" after after the "$" in angular observable?

I saw in the Angular tour of heroes tutorial, they declare hero$!: Observable; Why is there ! sign after the $ ? They are also initializing the hero observable in the ngOnInit ngOnInit() { this.hero$ = this.route.paramMap.pipe( …
1
2