2016-10-03 5 views
0

jenkins 플러그인에서 chartist.js를 사용하려고합니다. cdn - regular import (그리고 css)와 함께 libary를 가져 왔습니다.Jenkins의 차트 작성자 사용 - TypeError : 자체가 정의되지 않았습니다.

하지만 차트를 표시하는 대신 브라우저에서 "TypeError : self is undefined"가 표시됩니다. 나는 그들의 사이트에서 가장 간단한 chartist.js 예제를 사용하고있다.

오류를 생성하는 함수의 소스 코드는 다음 GitHub의 저장소에서 차티스트의 최신 버전으로 libary 폴더 업데이트하여 해결

/** 
 
    * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. 
 
    * 
 
    * @memberof Chartist.Svg 
 
    * @param {String} names A white space separated list of class names 
 
    * @return {Chartist.Svg} The wrapper of the current element 
 
    */ 
 
    function addClass(names) { 
 
    this._node.setAttribute('class', 
 
     this.classes(this._node) 
 
     .concat(names.trim().split(/\s+/)) 
 
     .filter(function(elem, pos, self) { 
 
      return self.indexOf(elem) === pos; 
 
     }).join(' ') 
 
    ); 
 

 
    return this; 
 
    }

답변

관련 문제