title: Putting ViewModel in AppComponent (Dagger2)
body: <p>In Dagger 2, Is putting All ViewModels inside AppComponent is the right place.</p>
  
  <p>Because I check this android <a href="https://github.com/android/architecture-samples/tree/dagger-android/app/src/main/java/com/example/android/architecture/blueprints/todoapp" rel="nofollow noreferrer">google sample</a>, All ViewModel scoped in the app component but I think the view model should be in it is view (Activity, Fragment) scope/subcomponent? </p>
  
  <p>something like this:</p>
  
  <pre><code>@ContributesAndroidInjector(modules = [LoginActivityModule::class])
  abstract fun contributeLoginActivity() : LoginActivity
  </code></pre>
  
  <p>-</p>
  
  <pre><code>@Module
  abstract class LoginActivityModule {
  
      @Binds
      @IntoMap
      @ViewModelKey(LoginViewModel::class)
      abstract fun bindLoginViewModel(viewModel: LoginViewModel): ViewModel
  }
  </code></pre>
  
  <p>To avoid memory-leak </p>
  
  <p>I need explanation.</p>