No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Dependency Injection with TS

    Help
    1
    1
    158
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jjurado last edited by

      Hi, I’ve got a project using plain Vue with Typescript but I’m using Dependency Injection for services… the main problem is that I need to “refactor” this line:

      new Vue({
            router,
            store,
            render: h => h(App)
          }).$mount('#app');
      

      For this one:

      class AppBootstrap {
        constructor() {
          this.loadDependencyContainer();
          this.loadApp();
        }
      
        loadDependencyContainer(): void {
          buildDependencyContainer();
        }
      
        loadApp(): void {
          Vue.config.productionTip = false;
      
          new Vue({
            router,
            store,
            render: h => h(App)
          }).$mount('#app');
        }
      }
      
      new AppBootstrap();
      

      But it has to be in ‘main.ts’ file… but obviously it creates conflict with Quasar…

      Anyone has tried to make something like this?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post