I am learning angular and trying to make a very easy hero list.
I have a list of hero in a json like this
{
"name" :"Bobby",
"avatar" : "myHero1.jpg",
"power" : "12",
"description" : "the strongest"
}
I load this json list in a component, where i want to display all of them in a table, and beeing able to click on them to see their stats in detail.
I want to cast that json in an simple typescript class/Object, so that I don't have to guess and hard coding this.hero["stats"]
and just have MyHeroClass.stats
.
My question is, in angular, where should i store this class, and how should I make it?
Does it have to be an exported component (with no html and css?) or can I make just a class somewhere and import it where i need it ?
thanks