Angular2设置元标题和描述 [英] Angular2 set meta title and description

查看:74
本文介绍了Angular2设置元标题和描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个angular2网站,并在构建它的同时按照本教程的内容设置了元标题和说明

I created an angular2 website and while i build it i setup the meta title and description along the lines of what this tutorial did http://blog.devcross.net/2016/03/20/angular-2-seo/. This seemed to work and the title in the browser actual updated ok. The problem is that when i do a view source of the site it still only shows me the html source which resides in the main index.html file not the updated values.

当我使用Firebug Lite在控制台中检查源代码时,它会向我显示更新的元标题和说明.

When i check the source in the console with firebug lite it shows me updated meta titles and the description.

我在做错什么或想念什么?

What am i doing wrong or missing?

推荐答案

看到页面的源代码时,没有执行任何javascript,因此您将无法看到Angular进行的更改.这是正常的.基于此,您没有做错任何事情.

When you see the page's source code, no javascript is executed, so you will not be able to see the changes aplied by Angular. This is normal. You aren't doing anything wrong based on that.

这篇关于Angular2设置元标题和描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆