0

I am enjoying the Tour of Heroes tutorial. Everything is working as it should but I'm really puzzled abou the http adding a hero functionality. It seems to magically know what id to assign to the new hero. I don't see any code anywhere that gets the max id of existing heroes anmd increments 1. Can someone explain?

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468

1 Answers1

0

It's a part of the 'in-memory-web-api' that is called as a mockup sercice. apparenly, it creates an id in case no id is passed. https://github.com/angular/in-memory-web-api#custom-genid

Shai Kimchi
  • 746
  • 1
  • 4
  • 22