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
0
votes
2 answers

Angular tour of heroes tutorial lesson 2 on Displaying a List: Add the click event handler

I am doing the Tour of heroes tutorial. When I add the following piece of code to my heroes.component.ts file I get an error that says "Property 'selectedHero' has no initializer and is not definitely assigned in the constructor." What should i do…
0
votes
2 answers

Angular Tour of Heroes Master Details Explanation

I know this may sound strange to all of you but for some reason I don't know how to explain myself why this would work, I am probably missing something crucial. So basically in angular-tour-of-heroes app, list of mock heroes is presented, you click…
Johnn
  • 47
  • 1
  • 2
  • 9
0
votes
1 answer

Puzzling Typescript function syntax in Angular Heroes example

I'm going through Angular's tutorial at https://angular.io/tutorial/toh-pt6 and I've got a couple of questions. My second question is very close to one asked here about the same Angular demo, but though it almost gets to my specific syntax question,…
Green Grasso Holm
  • 468
  • 1
  • 4
  • 18
0
votes
0 answers

Angular Tour Of Heroes Input property 'isn't a known property of' error

I followed the steps exactly as described in the angular 'Tour of Heroes' tutorial. I didn't get too far since after adding the 'heroe-detail' feature component I get to following error: fail: Microsoft.AspNetCore.SpaServices[0] …
0
votes
1 answer

TS2532: Object is possibly 'undefined' when testing Angular's Tour of Heroes

Just started writing test cases for Angular's Tour of Heroes, however when I run them I get a ERROR in src/app/hero.service.spec.ts:36:5 - error TS2532: Object is possibly 'undefined. I am very new to angular and I am struggling to find out what the…
0
votes
1 answer

Module won't get updated in Tour of Heroes Tutorial

I am doing the official "Tour of Heroes" Angular tutorial on angular.io. After adding a module called 'heroes', and showing it, everything was fine. The heroes.component.html only contained one p-tag saying "heroes works!". When I change it, my…
user12465043
0
votes
1 answer

Don't understand - Tour of heroes HTTP

I'm new to Angular and I started by doing the tutorial: "Tour of heroes". I didn't understand the HTTP part and I hope that somebody could explained to me. At some point they switched the mock-heroes with an InMemoryDataService and I understood…
abc
  • 494
  • 1
  • 8
  • 27
0
votes
1 answer

Angular 6 - Tour of Heroes - getHero - Error 404

I'm following the Angular 6 Tour of Heroes tutorial from https://angular.io/tutorial/toh-pt6 and all works well. The in-memory service works for the Dashboard, and the list of heroes displays fine. But when a hero is clicked and the hero detail's…
0
votes
2 answers

After the browser refreshes, the list of heroes doesn't appear

I've been progressing well on the angular tutorial "tour of heroes" until my list of heroes failed to display while using angular's repetitive directive, *ngFor. Using npm -v6.4.1 and node -v8.12.0. The code is exact to what is in the tutorial. I…
lasabahebwa
  • 281
  • 2
  • 14
0
votes
0 answers

Can't find the API being called in Tour of Heroes

I am learning Angular. I am studying the angular.io/tutorial Tour of Heroes at https://stackblitz.com/angular/akkkxgnylgd. In app/hero.service.ts, there is this code: @Injectable() export class HeroService { private heroesUrl = 'api/heroes'; //…
Old Geezer
  • 14,854
  • 31
  • 111
  • 198
0
votes
2 answers

Angular not able to retrieve list of heroes in Tour of Heroes

I am trying to build up the Tour of Heroes Application from The Angular Docs. After Defining my Array of Heroes and trying to loop through it, it only brings up empty divs. this is my code below: html

{{title}}

0
votes
1 answer

The http create function in Tour Of Heroes

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…
0
votes
3 answers

encountering errors when I try to run angular.io "tour of heroes" final plunk

I downloaded the final plunk for angular.io "tour of heroes" but I'm encountering errors. I'm using the package.json file from the first plunk because a package.json file isn't provided in the final plunk. npm start returns the errors below. This…
0
votes
1 answer

Angular 2: "Can't bind to 'ngModel'" error when FormsModule is imported in app.module

I've been stuck at the data binding part of this tutorial since yesterday https://angular.io/docs/ts/latest/tutorial/toh-pt1.html I've been getting this error Unhandled Promise rejection: Template parse errors: Can't bind to 'ngModel' since it…
Optiq
  • 2,835
  • 4
  • 33
  • 68
1
2