2017-05-24 1 views
0

비밀번호가 필요한 모달 창이 있습니다. 입력이 비어있는 경우에는 오류가있을 것이다, 나는 약자로 다음 툴팁이 전혀 표시되지 않는 오류가없는 경우, 오류를AngularJS 툴팁 툴팁이 작동하지 않음

<input type='password' class='form-control' id='password' ng-model='user.password' uib-tooltip='{{error_msg}}' tooltip-placement='right' tooltip-trigger='none' tooltip-is-open='true' tooltip-class='tooltip_error' tooltip-enable='{{error}}' autofocus> 

이 때 툴팁을 표시합니다. 오류가 발생하면 오류 메시지가 표시되지만 텍스트 상자 위로 마우스를 올려 놓으면 툴팁이 표시됩니다. 그 동안 나는 tooltip-is-opentrue으로 설정했지만 테스트하고 있지만 현재 작동하지 않습니다.

아이디어가 있으십니까?

답변

0

scope 속성을 나타내므로 tooltip-enable 지시문에서 interpolation operators({{}})을 제거하십시오.

변화는 코드처럼 :

<input type='password' class='form-control' id='password' ng-model='user.password' uib-tooltip='tootltip text : {{error_msg}}' tooltip-placement='right' tooltip-trigger='none' tooltip-is-open='true' tooltip-class='tooltip_error' tooltip-enable='error' autofocus> 

업데이트 : 우리는 그것으로 보간 연산자를 둘 필요가 있으므로 uib-tooltip 지시어는 입력으로 텍스트를합니다. 예상대로 나는`툴팁-enable`에 대한 작업을`{}`그냥 출력합니다 'ERROR_MSG'하지만 부울 결과를 않습니다 제거하면 Read more

plunker

+0

참조하십시오. –

+0

@ J.Do : $ scope 속성으로'error_msg'해야합니다. 예를 들어 '$ scope.error_msg = "암호에 오류가 있습니다." – anoop

+0

그래, 그게 내가 전에 가지고 있었던 것이지만'{} '. 또한 툴팁이 표시되도록 텍스트 상자 위로 마우스를 가져 가야합니다. –

관련 문제