title: calling typeScript function from VUE component
body: <p>I just started with VUE and I am stuck.</p>
  
  <p>I have a simple VUE component and the script part of it is:</p>
  
  <pre><code>&lt;script&gt;
  import Dish from './dish.vue'
  import SearchBar from './search.vue'
  import axios from 'axios'
  
  export default {
      components: {Dish, SearchBar},
      name: "selectDish",
      data() {
          return {
              dishes : []
          }
      },
      mounted(){     
      axios.get('http://example.com/',{method :'GET'})
      .then(response =&gt;{
          console.log(response);
          this.dishes=response.data
          })
      }
  }
  </code></pre>
  
  <p></p>
  
  <p>What I am trying to achieve is to remove the <code>axios API GET</code> call that I have inside the VUE compoennt as above and instead call the function that I have written inside my APIService.TS file which ultimately makes the <code>GET</code> call.</p>
  
  <p>My apiService.ts file is as Below:</p>
  
  <pre><code>import Promise, { config, resolve, reject } from 'bluebird';
  import Config from '../config';
  import axios from 'axios';
  
  export class APIService{
      constructor(){  }
      public giveMeAllDishes(dishType, query) : Promise&lt;string&gt;{
  
            return new Promise((resolve,reject) =&gt;{
                 axios.get('http://example.com',{method : 'GET'})
                 .then(function(respone){
                     console.log(respone);
                     resolve(respone.data);
                 })
                 .catch(function(err){
                     reject(err);
                 })
             })
      }
  }
  </code></pre>
  
  <p>When I put the <code>import APIService from '../../services/apiService'</code> inside the VUE component, I get an error saying :</p>
  
  <pre><code>ERROR in ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&amp;index=0!./src/components/selectDish/selectDish.vue
  Module not found: Error: Can't resolve '../../services/apiService'
  </code></pre>
  
  <p>Also, when I solve this referencing issue, How can I call the 'giveMeAllDishes' function of API Service from <code>VUE Component</code> ?</p>