title: Call Angular Component method from an imported library
body: <p>Here is my Angular component:</p>
  
  <pre><code>import { basketModule } from './wind'
  
  @Component({
    selector: 'app-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.css']
  })
  export class LoginComponent implements OnInit {
  
  
  
      constructor(){
      }
  
      ngOnInit(){
          basketModule.init()
      }
  
      public dataMain(){
          alert('hi')
      }
  }
  </code></pre>
  
  <p>Here is the wind.js file which is imported above.</p>
  
  <pre><code>export var basketModule = (function () {
  
  return {
  
    init: function(){
         dataMain()
      }
  
  }
  })();
  </code></pre>
  
  <p>When I run the above code, it returns an error that </p>
  
  <pre><code>core.es5.js:1020 ERROR ReferenceError: dataMain is not defined
  </code></pre>
  
  <p>How to access the Angular component method <code>dataMain</code> from the imported library ?</p>