Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] templateOnly appears in the wrong area, under Controller methods #19325

Closed
pzuraq opened this issue Dec 26, 2020 · 1 comment · Fixed by #19553
Closed

[Documentation] templateOnly appears in the wrong area, under Controller methods #19325

pzuraq opened this issue Dec 26, 2020 · 1 comment · Fixed by #19553

Comments

@pzuraq
Copy link
Contributor

pzuraq commented Dec 26, 2020

📙 Describe the Issue

templateOnly is importable from @ember/component/template-only according to the documentation, but it shows up in the API docs for Controller as a method.

🔬 Minimal Reproduction

https://api.emberjs.com/ember/3.23/classes/Controller/methods/templateOnly?anchor=templateOnly

😕 Actual Behavior

Appears in the Controller API docs

🤔 Expected Behavior

Should appear as a submodule of @ember/component

@Windvis
Copy link
Contributor

Windvis commented May 24, 2021

I think I figured out what causes this. The templateOnly doc comment describes a @method but the @ember/component/template-only module doesn't define a class. By default YUIDoc seems to link methods to the class that was last parsed (and in this case that seems to be the Controller class).

From the YUIDoc syntax reference:

@method Indicates that the block describes a method for the current class. By default, the "current" class is the last class that YUIDoc parsed, but you can reset this with the @for tag.

So the fix would be to add a @for to the doc comment. Itt seems that other exports are documented that way as well. For example the runloop exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants