如何解决此错误:模块'“ ../platform-b​​rowser/platform-b​​rowser”'没有导出的成员'DOCUMENT'

时间:2019-09-01 05:29:31

标签: angular8

编译时会发生

使用新的角度版本

import 'rxjs/add/operator/filter';
import { DOCUMENT } from '@angular/platform-browser';
import { LocationStrategy, PlatformLocation, Location } from '@angular/common';
import { NavbarComponent } from './shared/navbar/navbar.component';
    constructor( private renderer : Renderer, private router: Router, @Inject(DOCUMENT,) private document: any, private element : ElementRef, public location: Location) {}
    ngOnInit() {
        var navbar : HTMLElement = this.element.nativeElement.children[0].children[0];

0 个答案:

没有答案