Angular 在变量ionic3中分配html内容

Angular 在变量ionic3中分配html内容,angular,typescript,ionic3,Angular,Typescript,Ionic3,我试图在变量中分配组件的html内容,但它给出了错误 import { Component, ViewChild, ElementRef } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import * as jsPDF from 'jspdf'; import Relatorio1Page from './relatorio1'; /** * Gener

我试图在变量中分配组件的html内容,但它给出了错误

import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import * as jsPDF from 'jspdf';
import Relatorio1Page from './relatorio1';

/**
 * Generated class for the RelatoriosPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
    selector: 'page-relatorios',
    templateUrl: 'relatorios.html',
})

export class RelatoriosPage {

    constructor(public navCtrl: NavController, public navParams: NavParams) {

    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad RelatoriosPage');
    }

    @aViewChild('conteudo') conteudo: ElementRef;
    public relatorio1(){
        //the objective is to fill this variable with relatorio1Page inner html
        let conteudo = Relatorio1Page.innerHTML; 
    }

}
页面之间的层次结构是

页数 -关系1 --Relatorio1Page.ts -关系 --关系空间


您能帮助我吗?

对不起,您不能将该页面用作组件?

您的确切错误消息是什么?您何时调用
relatorio1()
?您是否尝试访问
Relatorio1Page.nativeElement.innerHTML
?请同时共享html文件。你的问题不清楚