Open alexbaron50 opened 6 years ago
Hi @ardatan, What do you mean by to mock subscribe to pass data? do you have a quick example? I have done the exact same step as @alexbaron50 in angular 6 and i'm facing the exact same issue.
@ardatan I am having the same issue as @DarkChopper mentioned. do you have example of it. @DarkChopper have you solved it?
@raza2022 Nope, i haven't yet.. I'm still running into it.
Hi, i use anular 6 and MCB, but now needed add SSR in my project, it is possible to use MCB with SSR on the server side ?
I have managed to integrate the MCB with an Angular application and make it work with Angular Universal on the server.
To make it work I just modified the angular-cli.json file to include the generated bundler script like this:
With this configuration a new file
script.[hash].bundle.js
is generated and it contains the needed meteor scripts to connect to the meteor server.To resolve the meteor dependencies I modified the tsconfig file so the packages resolves to and specific file where I export the desired package, specifically the paths option:
And finally inside the src folder I created a folder called
meteor_packages
and inside that folder I copied the meteor bundle generated, and a file for each package I need on the app. For example this is the content of mongo.jsI made a repository based on the Angular Universal Starter where you can see my code: https://github.com/alexbaron50/meteor-angular-universal
To make it work you just have to have a meteor server running on http://localhost:3015 and have published a collection by the name of settings.
When you run the application you will see that there is a connection between the app and the server, everything work as expected. However when I generate the needed files to make it run as SSR, all html is generated on the server except for the information that is grabbed from the sever. This is the code of the component where I grab the information:
In order to make the app fully SEO friendly I need to have that information rendered on the server, however this is the html that I get from that part:
This is the html you see when you view the source of the page, the component is rendered except for the part where I render the information gotten from the server
<!---->
.How can I make this part to be rendered on the server?