首页 > 解决方案 > 视图源角度 8 中未显示 Html 数据

问题描述

当我构建项目时,我无法在查看源代码上看到元标记,但是当放置静态数据时,它会显示在查看源代码中,但我可以将动态数据放在查看源代码中,因此我使用角度通用.

我为此使用角度 8

this.meta.addTags([
            {name: 'keywords', content: this.blogDetails.seo_keywords_en},
            {name: 'title', content: this.blogDetails.seo_title_en},
            {name: 'slug', content: this.blogDetails.seo_url_slug_en},
            {name: 'description', content: this.blogDetails.seo_description_en},
            {property: 'og:title', content: this.blogDetails.seo_title_en},
            {property: 'og:description', content: this.blogDetails.seo_description_en},
            {property: 'og:image', content: this.blogDetails.photo_file_seo},
            {property: 'twitter:description', content: this.blogDetails.seo_description_en},
            {property: 'twitter:title', content: this.blogDetails.seo_title_en},
            {property: 'twitter:image', content: this.blogDetails.photo_file},
        ], true);       

它从不显示任何错误,但数据未呈现,我使用此命令来构建和呈现数据

npm run build:ssr && npm run serve:ssr

标签: javascriptangulartypescriptdomangular8

解决方案


推荐阅读