2016-08-07 5 views
0

각도 재료 라이브러리를 사용하는 각도 응용 프로그램에서 토스트 메시지를 구현하려고합니다. TypeError: $mdToast.simple(...).textContent(...).action(...).highlightAction(...).highlightClass is not a function : 나는 showMessage()로를 호출 할 때이 나에게 오류를주고 몇 가지 이유를 들어 각도 재료 mdToast에 대한 highlightClass가 작동하지 않습니다.

 

    app.service('ToastFlash', ['$mdToast', function($mdToast) { 
     this.showMessage = function(message, $event) { 
     $mdToast.show(
      $mdToast 
      .simple() 
      .textContent(message) 
      .action("Dismiss") 
      .highlightAction(true) 
      .highlightClass('md-accent') 
     ); 
     }; 
    }]); 

. highlightClass 줄을 제거하면 완벽하게 작동합니다. 왜 이런 일이 발생합니까? 여기

답변

2
그것은 최신 자료 버전 v1.1.0-rc.5 JS 및 CSS 파일로 작업해야

,

$scope.showToast = function() { 
     var toast = $mdToast.simple() 
      .content('Hello world') 
      .action('OK') 
      .highlightAction(true) 
      .position('left top right') 
      .highlightClass('md-warn'); 
     $mdToast.show(toast); 
    }; 

는이 문제가 될 것입니다 ... 나는 1.0.9에 오전 작업 JsFiddle

+0

입니까? @Sajeetharan –

+0

파일을 변경하고 동일한 바이올린을 확인하십시오 – Sajeetharan

+0

@SiDDevesh가 도움이 되었습니까? – Sajeetharan

관련 문제