android / codelab-android-dagger

Apache License 2.0
183 stars 157 forks source link

injection on a private member #32

Closed minaNew10 closed 4 years ago

minaNew10 commented 4 years ago

in step 7 there is an injection annotation on a private member `class MainActivity : AppCompatActivity() {

// @Inject annotated fields will be provided by Dagger
@Inject
private lateinit var userManager: UserManager

@Inject
private lateinit var mainViewModel: MainViewModel

...

} class MainViewModel @Inject constructor(private val userDataRepository: UserDataRepository) { ... } class UserDataRepository @Inject constructor(private val userManager: UserManager) { ... }` Isn't it supposed for the annotation not to be on a private member