Q:

HTML import by DART command

I read this about HTML import, and wanted to do same using dart
the 'import.html' file is:
<div id='imp'>This is the div to be imported</div>

the index.html file is:
the imported div shall appear here: <output id="imported-div"></output>

the main.dart file, is:
void main() {
      Element output = querySelector('#imported-div');

      var link = document.querySelector('link[rel=import]');
      var importedFile = link.import;

      output.innerHtml=importedFile.querySelector('div.imp');
   }

but nothing happened, and I do not know where shall I write the imported file name!! and if I need to write the below statement in the index.html file, or there is no need of it:
<link rel="import" href="import.html">

Any thoughts!

A:

Some minor errors
The selector is wrong
// output.innerHtml=importedFile.querySelector('div.imp'); // requires <div class="imp">
//output.innerHtml=importedFile.querySelector('div#imp');  // requires <div id="imp">
output.append(importedFile.querySelector('div#imp'));      // append instead of innerHtml = (requires a String)

if you want to use the import more than once you can also do
output.append(importedFile.querySelector('div#imp').clone(true));

see also http://www.html5rocks.com/en/tutorials/webcomponents/imports/

