title: Integrating Treant-js in Angular2 Project
body: <p>I'm trying to make use of treant-js in an Angular2 project, and I'm struggling with how to properly integrate it.</p>
  
  <p>I have a working vanilla JavaScript / HTML example that I'm trying to make work in Angular2.</p>
  
  <p>I've created a component, added treant-js and raphael from npm, and imported them into the component.</p>
  
  <pre><code>import * as Raphael from 'raphael';
  import * as Treant from 'treant-js';
  </code></pre>
  
  <p>I've setup the html template and the corresponding css to match the standalone javascript project.</p>
  
  <pre><code>&lt;div class="tree-wrapper" &gt;
      &lt;div class="chart" id="test-tree"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And in the class I'm defining the tree-structure variable</p>
  
  <pre><code>   private tree_structure: any = {
          chart: {
              container: "#test-tree",
              levelSeparation: 20,
              siblingSeparation: 15,
              subTeeSeparation: 15,
              rootOrientation: "WEST",
  
              node: {
                  HTMLclass: "tree-wrapper",
                  drawLineThrough: true
              },
              connectors: {
                  type: "straight",
                  style: {
                      "stroke-width": 2,
                      "stroke": "#ccc"
                  }
              }
          },
  
          nodeStructure: {
              text: {
                  name: { val: "Djokovic, Novak", href: "http://... }
              },
              HTMLclass: "animal",
              image: "flags/can.jpg",
              children: [...
     *** the rest of the object graph continues ***
  }
  </code></pre>
  
  <p>In the JavaScript / HTML version, the tree is loaded in an inline script like this:</p>
  
  <pre><code>&lt;script&gt;
     new Treant( tree_structure );
  &lt;/script&gt;
  </code></pre>
  
  <p>What's the proper way to initialize this in Angular2?</p>
  
  <p>I was thinking something like this:</p>
  
  <pre><code>private tree: Treant = new Treant();
  
  ngOnInit() {
      tree ( this.tree_structure );
  }
  </code></pre>
  
  <p>However Treant isn't a function.</p>
  
  <p>I'm sure I'm missing something obvious here, but I can't wrap my head around this.</p>