# ViewModel Injection In Routes

> ViewModel Injection in Routes in the Mobile Action Pro course.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-11-viewmodel-injection-routes
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Dependency Injection with Koin
- Duration: 25 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-11-viewmodel-injection-routes.md

## Objectives

- Get a ViewModel in a route with koinViewModel and assign it to an interface-typed variable
- Use koinInject for platform seams and config in the UI, keeping the Screen unaware of Koin
- Correctly predict a ViewModel's owner in a destination and in a popup

## In this lesson

1. Lesson Goal
2. Part 1: The Route Is The Boundary Between Koin And UI
3. Part 2: Declaring An Interface Type
4. Part 3: koinInject For Things That Aren't ViewModels
5. Part 4: The Owner Of A Route And Of A Popup
6. Part 5: Navigation Callbacks Go Into The Route
7. Practice Exercise
8. Code Reading Path
9. Signs To Avoid
10. References
11. Key Points

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [Explicit Feature Registration](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-10-explicit-feature-registration.md)
- Next lesson: [Testing With Koin](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/07-dependency-injection/lesson-12-testing-with-koin.md)
