How to access about model from a component? (outletArgs to the rescue!)

I want to put the old about statistics on the about page.

There is a about-wrapper that replaces the entire about page. There is also a an after-moderators outlet. Neither of those works exactly right, but I think I know some solutions for that (e.g., submit a PR with some more plugin outlets in the new about template).

/about.json includes the old about statistics, but I can’t figure out how to access them in my component. I don’t see it in this, though I do see Users (which is also in about.json).

EDIT: Well, I thought I’d searched, but now I see Hide public statistics from /about and about.json - #2 by merefield, which might help? No. That’s something else.

I just had a breakthrough. It’s in the outletArgs.

import Component from "@glimmer/component";
import { dasherize } from "@ember/string";

export default class ClassicAboutStatistics extends Component {
   get model () {
    return this.args.outletArgs.model;
  }

  get shouldShow() {
    return settings.classic_about_statistics_enabled?.length > 0;
  }
}

So then I can access it as in the original template:

        <td>{{number this.model.stats.topics_last_day}}</td>
7 Likes