title: How to move the Koin ViewModel injection to the Base fragment?
body: <p>I am using Koin for dependency injection and also use injections for the ViewModel. I have <em>several Fragments</em> with the <em>corresponding ViewModel</em>.</p>
  <pre><code>class Fragment1 : BaseFragment(R.layout.fragment1) { 
     private val viewModel: Fragment1ViewModel by inject()  
        
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
          viewModel.testVM1()
      }
  }  
    
  class Fragment2 : BaseFragment(R.layout.fragment2) { 
     private val viewModel: Fragment2ViewModel by inject()  
        
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
          viewModel.testVM2()
      }
  }  
  </code></pre>
  <p>For all fragments I use <strong>BaseFragment</strong></p>
  <pre><code>class BaseFragment(@LayoutRes private val layoutId: Int) : Fragment() {   
  
     override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View = inflater.inflate(layoutId, container, false)
  }   
  </code></pre>
  <p><strong>My goal</strong> is to inject the ViewModel into the BaseFragment and use the variable in the child fragments.</p>
  <p>I changed the code as follows:</p>
  <pre><code>class BaseFragment&lt;T: ViewModel&gt;(@LayoutRes private val layoutId: Int) : Fragment() {   
     val viewModel: TypeToken&lt;T&gt; by inject() 
  
     override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View = inflater.inflate(layoutId, container, false)
  }   
  
  class Fragment1 : BaseFragment&lt;Fragment1ViewModel&gt;(R.layout.fragment1) {
  
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
          viewModel.testVM1() // Unresolved reference: testVM1()
      }
  }  
  
  class Fragment2 : BaseFragment&lt;Fragment2ViewModel&gt;(R.layout.fragment2) { 
  
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
          viewModel.testVM2() // Unresolved reference: testVM2()
      }
  }   
  </code></pre>
  <p>But in this case I am getting an error <code>Unresolved reference: testVM1()/testVM2()</code> for calling methods in the child fragments.</p>
  <p><strong>Question:</strong> How do I change the code to make it work? thanks</p>