<body>
来在角组件中获取 <head>
和DOCUMENT
标签,就像这样:
import { DOCUMENT } from '@angular/common';
import { Inject } from '@angular/core';
export class TestComponent {
constructor(
@Inject(DOCUMENT) private document: Document
)
// get <head>
// this.document.head
// get <body>
// this.document.body
}
但是可以在Angular组件中获得<html>
标签吗?