0

I am using zingchart in my angular2 application and came a cross this problem. when I am trying to click the node - I get:

angular2.dev.js:23730 EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'parentNode' of null

when I try to do that same when I am in debug mode - i.e. do it slower when jumping from line to line everything works fine.

I read a lot about about the Uncaught (in promise): TypeError: here and tried some solutions but with no luck. Maybe anyone have an idea for me? Thanks

I have a pie chart: Which have the following code:

render(){
  this.zone.runOutsideAngular(() => {
      zingchart.render({
          id : this.chart['id'],
          data : this.chart['data'],
          width : this.chart['width'],
          height: this.chart['height']
      });

      zingchart.node_click = function(p) {
          window.location.href = #/resources";
      }
 });}

my resource component is very simple:

import { Component } from 'angular2/core';
   @Component({ 
           selector: 'resources-component',
           templateUrl: `I am the resource page`,
    })
    export class ResourcesComponent {
          title: string = 'resources';
          constructor() {
         }
    }
Merrily
  • 1,686
  • 10
  • 14
Noa
  • 337
  • 2
  • 4
  • 11
  • 1
    Would you be able to replicate it in a fiddle? It works for me in a small POC. Also, not sure if this is a typo in your question and/or your code but your callback for window.location.href = #/resources"; is missing a quote. – mike-schultz Jun 23 '16 at 15:11
  • Thanks @mike-schultz The problem is with the animation. when I removed the animation part every thing worked. – Noa Jun 27 '16 at 11:00

0 Answers0