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
  • 1,750
  • 3
  • 17
  • 27

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.