2016-08-17 3 views
0

내 프로젝트의 모든 페이지에서 각도 재료 토스터를 사용해야하고 메시지에 html 태그가 포함될 수 있습니다. 그러나 HTML 메시지가 Angular Material Toaster와 함께 작동하지 않습니다.<br>의 Html 메시지가 간단한 각도 재료로 작동하지 않습니다. Toaster

$mdToast.show(
    $mdToast.simple() 
     .textContent('Field is required <br> Some Other Content') 
     .position(pos) 
     .hideDelay(3000) 
); 

아이디어가 있으십니까?

+0

당신은 템플릿 속성을 사용할 수 있습니다 할 수 있습니다. 아래에 예제를 보여줍니다. –

답변

1

예를 들어, 그렇게 할 수 있습니다.

var displayToast = function(type, msg) { 
    $mdToast.show({ 
     template: '`<br/>`' + msg + '`<br/>`', 
     hideDelay: 6000, 
     position: 'bottom right' 
    }); 
}; 
0

그렇게

$mdToast.show({ 
      hideDelay : 3000, 
      position : 'top right', 
      templateUrl : 'your_template.html' 
     }); 

및 템플릿에

<div>Field is required <br> Some Other Content</div>