title: Error property does not exist in angular
body: <p>I have a number type initialized at the beginning of my component class like this:
  My component class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import { .....
  
  
  @Component({
     ....
  })
  export class JhiLoginModalComponent implements  OnInit {
     
      a: number;
   
  
     
      ngOnInit() {
        this.method();
  
      }
      method() {
       a=3;
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>My testing class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import {...
  
    describe('LoginComponent', () =&gt; {
    
      let comp: ComponentClass;
          let fixture: ComponentFixture&lt;ComponentClass&gt;;
            beforeEach(async(() =&gt; {
              TestBed.configureTestingModule({
                ............
          }));
          
            beforeEach(() =&gt; {
              fixture = TestBed.createComponent(ComponnetClass);
              comp = fixture.componentInstance;
              ....
                });
                //MY TEST
                  it ('Should print a value', async(() =&gt; {
  fixture.detectChanges();
              console.log('lalalalla' + comp.method.a); //It prints lalalaundefined
              
          }));</code></pre>
  </div>
  </div>
  </p>
  
  <p>It returns undefined when I print domElement and the error: Property <strong>a</strong> is undefined for type any</p>
  
  <p>Do I make an error in injection?? How can I access the component elements otherwise?? If I use this number later it says that it is undefined.</p>