angular-universal

angular universal update meta tags with dynamic content

邮差的信 提交于 2020-01-04 06:31:15
问题 Hey I'm having an issue I have this blogs page that brings in dynamic data, and with that data I want to use it to populate meta tags so for example I'm doing something like this getBlogPost() { this.http.get(...) .subscribe(result => { this.blogPost = result; this.meta.updateTag({ name: 'description', content: this.blogPost.fields.metaDescription }); this.meta.updateTag({name: 'robots', content: 'INDEX, FOLLOW'}); this.title.setTitle(this.blogPost.fields.blogName); this.meta.updateTag({name:

angular universal update meta tags with dynamic content

大城市里の小女人 提交于 2020-01-04 06:31:05
问题 Hey I'm having an issue I have this blogs page that brings in dynamic data, and with that data I want to use it to populate meta tags so for example I'm doing something like this getBlogPost() { this.http.get(...) .subscribe(result => { this.blogPost = result; this.meta.updateTag({ name: 'description', content: this.blogPost.fields.metaDescription }); this.meta.updateTag({name: 'robots', content: 'INDEX, FOLLOW'}); this.title.setTitle(this.blogPost.fields.blogName); this.meta.updateTag({name:

DeprecationWarning: Buffer() is deprecated due to security and usability issues

北战南征 提交于 2020-01-03 15:54:11
问题 I downloaded below angular project and followed their instruction to install. https://snipcart.com/blog/angular-seo-universal-server-side-rendering npm install ... works fine. ng serve .... works fine npm run build:ssr && npm run serve:ssr ... this giving an error. (node:5644) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. I am using node version v10.1.0 on

Angular Universal - How to trigger manually the state change from server side to client view?

假如想象 提交于 2020-01-02 18:57:30
问题 We have a simple Angular Universal app using angular/cli: 1.4.3 (and node: 6.9.5). We manage to configure the server side view. When the dom is ready, we switch to a client view. But, the switch is made before we collect all the data needed from the API. So there is a moment right after the switch when the page is displayed without the data. Is there any way to trigger manually the switch between the 2 states? In this case, we want to display the client view after we get the response from the

Angular Universal - How to trigger manually the state change from server side to client view?

怎甘沉沦 提交于 2020-01-02 18:57:16
问题 We have a simple Angular Universal app using angular/cli: 1.4.3 (and node: 6.9.5). We manage to configure the server side view. When the dom is ready, we switch to a client view. But, the switch is made before we collect all the data needed from the API. So there is a moment right after the switch when the page is displayed without the data. Is there any way to trigger manually the switch between the 2 states? In this case, we want to display the client view after we get the response from the

Component CSS Disappears from Components During App Bootsrapping With Preboot

人盡茶涼 提交于 2020-01-02 06:48:12
问题 My beautiful server-side rendered Angular 5 application (using Universal with a node express.js server) is having problems with styling during the bootstrap (preboot) phase. The global CSS stylesheet seems to be fine, but the component-specific styles disappear once bootstrapping begins. Example: Component styling with javascript disabled (pure html and css from the server): Component styling with javascript enabled and before app starts bootstrapping (still fine, still pure html and css from

Add static pre-rendering to ng add @nguniversal/express-engine

感情迁移 提交于 2019-12-30 01:23:07
问题 I added server side rendering to my Angular project by following the Angular documentation here. I found out that the commands to run the static pre-rendering npm run build:prerender and npm run serve:prerender were not here after using the CLI command: ng add @nguniversal/express-engine --clientProject [angular.projet] I am wondering if the static pre-rendering is still supported in Universal? The code generated is all about dynamic SSR. That's weird because I found these commands on the

Implementing a plugin architecture / plugin system / pluggable framework in Angular 2, 4, 5, 6

ぐ巨炮叔叔 提交于 2019-12-28 01:38:12
问题 Update 5/24/2018: We are now +3 versions of Angular from my original post and still don't have a final workable solution. Lars Meijdam (@LarsMeijdam) has come up with an interesting approach which is certainly worth a look-see. (Due to proprietary issues, he had to temporarily remove the GitHub repository where he had originally posted his sample. However, you may message him directly if you would like a copy. Please see the comments below for more info.) Recent architectural changes in

Unable to find plugin: videoJsResolutionSwitcher in angular2-universal

老子叫甜甜 提交于 2019-12-25 08:35:47
问题 In the first implementation, I used angular2 without server rendering for creating a web player with video.js library and it's "videojs-resolution-switcher" plugin. I created a directive for initializing videojs element based on component ngOnInitView and load js files directly in base html file (end of body). Everything was correct and player worked as expected. Then I started to setting up angular2-universal and server rendering. There was some problems about using browser specific features

How to deploy Angular Universal app to Node.js production server?

做~自己de王妃 提交于 2019-12-25 01:52:44
问题 I have an Angular 8 application with Universal that I want to deploy to a shared web host production server. I checked with the web host in advance and they told me that hosting an angular universal web app is possible on their shared web hosting. However, whatever I do, I can't get the website to work. When I go to the website I keep seeing the message: "This site can't be reached" Things I have done so far: Build project with npm run build:ssr which created a dist folder with a browser and