-
Notifications
You must be signed in to change notification settings - Fork 52
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
Approach to dealing with nested smart/ dumb components #2
Comments
Precisely the reason for
|
From @goelinsights on April 23, 2018 23:20 @NathanWalker that sounds awesome! Can't wait. Followup. I'll have two versions of SSR (AMP and normal web SSR'd for SEO purposes) + web for the admin version of the site. Is the syntax adaptable to something like xplat/ssr-web & xplat/ssr-amp? Or could we create a xplat/amp that pulls from SSR default configs? Or would we do something like create the base generics in the SSR folder and then apply the specific html templates in the apps folder? |
As far as |
Oh nice really appreciate your feedback btw, yes we can definitely plan on supporting |
From @goelinsights on April 23, 2018 19:53
Trying to figure out the pattern for injecting nested smart and dumb components. Is the solution to re-create them but extract the repeating function logic in the components into services?
Example (gallery with a list of photos. Smart/dumb component pattern for gallery but not for photo using material design):
app-gallery-page.component.html
In the current angular smart/ dumb approach you use the html template for AppGalleryPage to drive the remainder of what's displayed downstream. Is there any way to reuse all of this (i.e., swapping out HTML templates using a conditional in templateUrl that would compile, etc, that would be smaller than stuffing all of the HTML for different versions with a flag?)
In this case, say material design only works in a SSR (web) and Admin (web) version of the app, but you'd want to reuse the logic in the smart component as a starting point for the AMP version but need a different HTML setup, is there a way to do this that would be better than shipping a bunch of conditional IF blocks, i.e.,?
app-gallery-page.component.html
Similar question on if that means that we'd need to ship all the code related to the Admin version so things don't break, despite creating a much lighter non-admin app if we can avoid loading that code.
Copied from original issue: nstudio/xplat-issues#3
The text was updated successfully, but these errors were encountered: