https://kotlinlang.org logo
#android
Title
# android
m

Muhammad Usman

02/28/2020, 5:42 AM
Copy code
private val registerViewModel by viewModels<RegisterViewModel> (userDao)
how can i pass object instance to viewModel using by viewModels extentions , like i want to pass userDao to RegisterVIewModel
s

Samme Kleijn

02/28/2020, 6:12 AM
You can do this using a ViewModelFactory or by a dependency injector such as Koin