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

support named outlet #11

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ class MyRouteComponent extends Component {
export default RoutableComponentRoute(MyRouteComponent);
```


```gjs
// app/routes/my-route.gjs
import RoutableComponentRoute from 'ember-routable-component';
import Component from "@glimmer/component";

class MyRouteComponent extends Component {
<template>Hello, {{this.message}}. Why was I screaming? {{yield 'my-name' to='named-outlet'}}</template>

get message() {
return String(this.args.model).toUpperCase();
}
}

export default RoutableComponentRoute(MyRouteComponent);
```


With this feature, it eliminates most of the reasons for needing controllers,
other than for query params (which is another coherence gap Polaris would need
to address). We suggest exploring moving your non-QP controller logic into a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { precompileTemplate } from '@ember/template-compilation';

export default precompileTemplate("<this.Component @model={{this.model}} @controller={{this}}><:outlet>{{outlet}}</:outlet></this.Component>");
export default precompileTemplate(`<this.Component @model={{this.model}} @controller={{this}}>
<:outlet>{{outlet}}</:outlet>
<:named-outlet as |name|>{{outlet name}}</:named-outlet>
</this.Component>`);
Loading