ember-cli / ember-cli/eslint-plugin-ember

Question about recommended way to access a controller from a route given `no-controller-access-in-routes` rule

Open
#1,108 8 comments 4 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

Accessing `this.controllerFor()` property inside `setupController/resetController` method in a route class raises a lint error ( `no-controller-access-in-routes`). Is that the expected behavior and if yes, how can one access another controller in a route class.

I am accessing the controller to setup route transition redirect like [this](https://guides.emberjs.com/release/routing/preventing-and-retrying-transitions/#toc_storing-and-retrying-a-transition) (I could opt to use query params or disable the lint on the affected LOC but is there an option to access another controller in a route)

![Screenshot_from_2021-03-09_14-32-38](https://user-images.githubusercontent.com/25152892/111468859-16c6a400-8737-11eb-8177-4ad03e48b418.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.