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

Add support for children/transclusion #12

Open
bcherny opened this issue Apr 4, 2017 · 6 comments
Open

Add support for children/transclusion #12

bcherny opened this issue Apr 4, 2017 · 6 comments

Comments

@bcherny
Copy link
Contributor

bcherny commented Apr 4, 2017

See #11:

  1. Mark the component as transclude: true
  2. Compile transcluded children in the component's scope
  3. Convert the compiled elements to JSX, and pass them to the component as children

For step 2, the $transclude service could be a good way to go.

Step 3 is where things get hairy. Ideally we would pass the DOM provided by $transclude through something like htmltojsx and into the React component. Alternatively we could pass in transcluded DOM via this.props or this.context, and make rendering it the consumer's responsibility.

@Sawtaytoes
Copy link

Is there a possibility of this getting merged in?

@bcherny
Copy link
Contributor Author

bcherny commented Dec 3, 2017

Pinging @spirosikmd ^

@spirosikmd
Copy link

I don't have the time now to work on this. There is still the issue left with updating transcluding children after the scope is updated. Couldn't figure out a way to accomplish this.

@coreysnyder
Copy link

coreysnyder commented Jun 25, 2018

Is there any support for having transclusion with AngularJS components? I have a sidebar-wrapper that contains 2 components, one of which (<ui-view/>) isn't something I can re-write as a react-component.

<sidebar-wrapper>
    <project-branch-breadcrumb></project-branch-breadcrumb>
    <ui-view></ui-view>
</sidebar-wrapper>

I re-wrote project-branch-breadcrumb as a react component wrapped in an angular component using react-2-angular but I am not exactly sure how to do that for ui-view since it's a core angular element.

I'm getting this error angular.js:14328 Invariant Violation: Target container is not a DOM element.. Any advice on how to proceed? I can't really NOT use this sidebar-wrapper as it's a core part of our UI.

@tgfischer
Copy link

Is there any support for having transclusion with AngularJS components? I have a sidebar-wrapper that contains 2 components, one of which (<ui-view/>) isn't something I can re-write as a react-component.

<sidebar-wrapper>
    <project-branch-breadcrumb></project-branch-breadcrumb>
    <ui-view></ui-view>
</sidebar-wrapper>

I re-wrote project-branch-breadcrumb as a react component wrapped in an angular component using react-2-angular but I am not exactly sure how to do that for ui-view since it's a core angular element.

I'm getting this error angular.js:14328 Invariant Violation: Target container is not a DOM element.. Any advice on how to proceed? I can't really NOT use this sidebar-wrapper as it's a core part of our UI.

I'm also hoping to do something like this

@chiptus
Copy link

chiptus commented Oct 28, 2021

Is there any support for having transclusion with AngularJS components? I have a sidebar-wrapper that contains 2 components, one of which (<ui-view/>) isn't something I can re-write as a react-component.

<sidebar-wrapper>
    <project-branch-breadcrumb></project-branch-breadcrumb>
    <ui-view></ui-view>
</sidebar-wrapper>

I re-wrote project-branch-breadcrumb as a react component wrapped in an angular component using react-2-angular but I am not exactly sure how to do that for ui-view since it's a core angular element.

I'm getting this error angular.js:14328 Invariant Violation: Target container is not a DOM element.. Any advice on how to proceed? I can't really NOT use this sidebar-wrapper as it's a core part of our UI.

for ui-view look at ui-router/react-hybrid

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

Successfully merging a pull request may close this issue.

6 participants