mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 17:59:05 +08:00

Available as a normal synchronous module in tests Available as an async import in core, or via the `loadFaker` helper in themes/plugins (which cannot use async import directly)
17 lines
503 B
JavaScript
17 lines
503 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { service } from "@ember/service";
|
|
import { allCategories } from "discourse/plugins/styleguide/discourse/lib/styleguide";
|
|
|
|
export default class Styleguide extends Route {
|
|
@service styleguide;
|
|
|
|
async model() {
|
|
await this.styleguide.ensureFakerLoaded(); // So that it can be used synchronously in styleguide components
|
|
return allCategories();
|
|
}
|
|
|
|
setupController(controller, categories) {
|
|
controller.set("categories", categories);
|
|
}
|
|
}
|