0

Is there a way to retrieve the HTML from a imported component in Ionic2/Angular2?

So, for example:

import {A} from '../../components/a/a';

console.log(A.html());

Something similar to this - obviously there is no html method attached to the component here but I'm after something similar.

Josh
  • 2,430
  • 4
  • 18
  • 30

1 Answers1

2

I've never done that, but if I had to do it, it'd be something like this

import { A } from './a';
import { ViewChild } from '@angular/core';

// ...
@ViewChild('A') a: A;

Then I guess, in that variable, you could retrieve your HTML.