You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Angular Universal (with CI job to test all components) #308
There's no automated verification that all material components are safe to use in node, i.e. pre-rendering with Angular Universal. See #306.
Proposal
Create a step in the CI process to pre-compile a single root component which contains an instance of each material component. Use one of the Angular Universal pre-render libraries to build: https://github.com/angular/universal/tree/master/modules
Note: I'm planning to submit a Broccoli plugin to that repo which would work well with Angular CLI.
changed the title [-]test: add CI step to test each component in pre-render build step with Angular Universal[/-][+]Add CI job to test all components in pre-render build step with Angular Universal[/+]on Apr 14, 2016
To report one problem unsolved in #774 and #883, Material is not working with Universal for now because of many reference to window in Material umd bundles.
As proposed by @orangesoup, adding var window = undefined; in Material umd bundles do the trick for now, and then Universal and Material work very well together in my test app.
I looked at Material TypeScript source files, and found very few direct reference to window (and it's not the same as in umd bundles). So I think it is just a problem with the umd packaging system (maybe configured to target browsers). It's beyond my skills, but I think it's just a bundling option to change, and Material would already work with Universal.
Same problem than @BlankHrt , hammerjs seems to have nothing to do with this error. I didn't import it anywhere, but I have the exact same error :
/dist/ngfactory/node_modules/@angular/material/typings/index.ngfactory.ts:9
import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
Any idea?
Reacted by Tomer David Ben Zohar, BlankHrt and SwagMuffinMcYoloPants
Hey guys!
For some reasons this repos works with material design, SSR and AOT. You can see it in action right here.
I think the problem is coming from a misconfiguration of the server side rendering in my (our) setup(s), because I've been able to fix this issue by double checking the official instructions.
I'm going to use this repo for my own needs, just to earn some time, it's a pretty good seed. Thanks to @JayChase for his answer on my stackoverflow post
Reacted by Francesco, Orhun Beğendi, Anas and Mateja Petrovic
I need to render matDialog on the server side. I see that it's impossible for now because @angular/material uses the document object for the dialogs rendering.
Could you please tell me will you add possibility to render dialogs on the backend?
If yes please tell me do you have an idea when this changes will be released?
We don't have plans to support overlay-based components rendering on the server at this time (dialogs, menus, etc.). For the vast majority of cases, these components are only rendered in response to user interaction
Reacted by Charles Samborski, Francesco, Dayana Jabif, Kirill, JM Robles and Mateja Petrovic
25 окт. 2017 г., в 19:52, Jeremy Elbourn ***@***.***> написал(а):
We don't have plans to support overlay-based components rendering on the server at this time (dialogs, menus, etc.). For the vast majority of cases, these components are only rendered in response to user interaction
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
Users/hoangcuulong/website-cli-beecow/dist/server.js:218913
__extends(LoginFormModel, _super);
^
ReferenceError: __extends is not defined
at /Users/hoangcuulong/website-cli-beecow/dist/server.js:218913:5
at Object.../../../../../src/app/_models/login.model.ts (/Users/hoangcuulong/website-cli-beecow/dist/server.js:218920:2)
at __webpack_require__ (/Users/hoangcuulong/website-cli-beecow/dist/server.js:164408:30)
at Object.../../../../../src/app/_models/index.ts (/Users/hoangcuulong/website-cli-beecow/dist/server.js:218497:10)
at __webpack_require__ (/Users/hoangcuulong/website-cli-beecow/dist/server.js:164408:30)
at Object.../../../../../src/app/_shared/utils/beecow.utils.ts (/Users/hoangcuulong/website-cli-beecow/dist/server.js:224130:15)
at __webpack_require__ (/Users/hoangcuulong/website-cli-beecow/dist/server.js:164408:30)
at Object.../../../../../src/app/market/popup-location/popup-location.component.ts (/Users/hoangcuulong/website-cli-beecow/dist/server.js:229039:22)
at __webpack_require__ (/Users/hoangcuulong/website-cli-beecow/dist/server.js:164408:30)
at Object.../../../../../src/$$_gendir/app/market/popup-location/popup-location.component.ngfactory.ts (/Users/hoangcuulong/website-cli-beecow/dist/server.js:177242:10)
Activity
[-]test: add CI step to test each component in pre-render build step with Angular Universal[/-][+]Add CI job to test all components in pre-render build step with Angular Universal[/+]cyrilletuzi commentedon Sep 14, 2016
To report one problem unsolved in #774 and #883, Material is not working with Universal for now because of many reference to
windowin Material umd bundles.As proposed by @orangesoup, adding
var window = undefined;in Material umd bundles do the trick for now, and then Universal and Material work very well together in my test app.I looked at Material TypeScript source files, and found very few direct reference to
window(and it's not the same as in umd bundles). So I think it is just a problem with the umd packaging system (maybe configured to target browsers). It's beyond my skills, but I think it's just a bundling option to change, and Material would already work with Universal.131 remaining items
galtalmor commentedon Sep 15, 2017
@BlankHrt see this comment for a solution that works around the issue.
glemiere commentedon Sep 16, 2017
Same problem than @BlankHrt , hammerjs seems to have nothing to do with this error. I didn't import it anywhere, but I have the exact same error :
/dist/ngfactory/node_modules/@angular/material/typings/index.ngfactory.ts:9
import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
Any idea?
julienR2 commentedon Sep 16, 2017
Hi ! I would need some info to help you out.
Hope we can figure out what's going on !
tomerBZ commentedon Sep 16, 2017
@glemiere I am having the exact same issue here:
import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
I didn't import HammerJs anywhere.
glemiere commentedon Sep 17, 2017
Hey guys!
For some reasons this repos works with material design, SSR and AOT. You can see it in action right here.
I think the problem is coming from a misconfiguration of the server side rendering in my (our) setup(s), because I've been able to fix this issue by double checking the official instructions.
I'm going to use this repo for my own needs, just to earn some time, it's a pretty good seed. Thanks to @JayChase for his answer on my stackoverflow post
atmman9001 commentedon Oct 25, 2017
Hey guys.
I need to render matDialog on the server side. I see that it's impossible for now because @angular/material uses the document object for the dialogs rendering.
Could you please tell me will you add possibility to render dialogs on the backend?
If yes please tell me do you have an idea when this changes will be released?
jelbourn commentedon Oct 25, 2017
We don't have plans to support overlay-based components rendering on the server at this time (dialogs, menus, etc.). For the vast majority of cases, these components are only rendered in response to user interaction
atmman9001 commentedon Oct 25, 2017
longhoang2984 commentedon Nov 6, 2017
How about the error
While I extends two Model?
damienwebdev commentedon Nov 23, 2017
@jelbourn In reference to MatDialog, MatMenu, and render-only-on-interaction components, how are we supposed to properly handle this?
I couldn't quickly find any documentation on SSR with angular material, I checked here: https://material.angular.io/guides as well as on the component itself, https://material.angular.io/components/menu/overview
Additionally, in the given example, https://material.angular.io/components/menu/examples
mat-menufails on universal.If you could give some guidance on what we're supposed to do, I'd happily write the guide and submit a PR.
fdambrosio commentedon Nov 24, 2017
I agree with @damienwebdev
there's no docs about SSR and Material
jelbourn commentedon Nov 29, 2017
Closing this now since everything should mostly work with SRR this this point in time. Individual bugs can be tracked via standalone issues.
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.