title: <Angular CLI> Use script inside HTML with a parameter from another .ts file
body: <p>Good afternoon!</p>
  
  <p>I'm sorry if I'm unable to get this clear, but here's the problem:</p>
  
  <p>i have a file named "heroes.ts", where I have many objects for a "Hero" class (which is exported from another file), here you can see a fragment of it --></p>
  
  <pre><code>import { Hero, Villain } from '../hero';
  
  export const HEROES: Hero[] = [
  
  { id: 78251, name: 'Fareeha Amari',            codename: 'Pharah',        alive:true  },
  { id: 15964, name: 'Gengi Shimada',            codename: 'Gengi',         alive:true  },
  { id: 21345, name: 'Angela Ziegler',           codename: 'Mercy',         alive:true  },
  { id: 84519, name: 'Lena Oxton',               codename: 'Tracer',        alive:true  },
  { id: 64518, name: 'Jeese Mccree',             codename: 'Mccree',        alive:true  }, 
  
  ..............]
  </code></pre>
  
  <p>these pieces of information are used inside another file, called "heroes.component.html". After a certain point, i need to call this data. And I do it like this (mostly, without any problem): </p>
  
  <pre><code>&lt;h2&gt;Heroes&lt;/h2&gt;
  
    &lt;ul id="heroes"&gt;
  
  &lt;li *ngFor="let hero of heroes" 
  [class.selected]="hero === selectedHero" 
  (click)="onSelect(hero)"&gt; 
  
    &lt;p&gt; ID: {{hero.id}} | {{hero.name}}, codename {{hero.codename}}. 
    &lt;!-- Until here, everything is AOK and printed --&gt; 
    Status: &lt;script&gt; aliveDead()  &lt;/script&gt; &lt;/p&gt;  
    &lt;!-- Here lies the preoblem, nothing gets printed after "Status --&gt; 
  &lt;/li&gt;
  </code></pre>
  
  <p></p>
  
  <p>You must be wondering where is aliveDead(), i have this function in this same file:</p>
  
  <pre><code> &lt;script&gt;
  
      function aliveDead()
      {
        if( hero.alive == 1 )
        {
          return "Active";
        }
        else
        {
          return "Dead";
        }
      }
  //OBS: i tried using hero.alive and hero as parameters for this function
  //it does not work
  &lt;/script&gt;
  </code></pre>
  
  <p>I need to make this function run inside the script tags and return me a value that can be printed after the "Status" using, as parameter, the information provided from the first chunck of code ( "heroes.ts" )</p>
  
  <p>Again, i'm sorry if i can't really explain that well, but i did my best</p>
  
  <p>thanks anyway,</p>
  
  <p>chab</p>