我可以添加Twitter卡而不将其放入标签中吗?

时间:2016-01-12 01:56:04

标签: html twitter metadata twitter-card

我正试图找到一种方法将Twitter Card元数据放在我网站的/*** BookComponent ***/ @RouteConfig([ {path: "/books/:id", component: BookDetailComponent, as: "BookDetail"}, ]) export class BookComponent { } /*** BookDetailComponent ***/ export class BookDetailComponent { book:Book; constructor(private bookService:BookService, private routeParams:RouteParams) { } ngOnInit() { let id = this.routeParams.get("id"); this.bookService.getBook(parseInt(id)) .subscribe(book => this.book = book.json()); } } 标记内。目前无法访问它,所以是否可以将其添加到代码中的其他位置?

1 个答案:

答案 0 :(得分:0)

这是无效的HTML,不推荐使用。为什么您无法访问<head>

阅读本文:What happens if the meta tags are present in the document body?

我建议先搜索之前已经回答过的问题。