angular-ui-bootstrap: Implementing html in popover using popover-html

让人想犯罪 __ 提交于 2019-12-13 07:06:25

问题


I'm trying to implement a popover to activate when a glyphicon is clicked. Inside the popover I want to show a link to go to a new page.

I'm on angular-ui version 0.13.4.

I found: Angularjs ui bootstrap - put html inside popover so I'm trying to do something similar.

My html looks like <i class="glyphicon glyphicon-info-sign" popover-html="displayLinkGoToWorkflowAssessment(studentInfo)" popover-title="In Progress"></i>

And in my controller:

$scope.displayLinkGoToWorkflowAssessment = function (studentInfo) { return '<a ng-href="/assessment/workflowAssessment/{{$routeParams.accountID}}/{{studentInfo.Student.StudentID}}/{{studentInfo.WorkflowAssessmentVersionID}}">Jody</a>'; }

The link appears but nothing happens when I click.

I've also tried:

$scope.displayLinkGoToWorkflowAssessment = function (studentInfo) { return '<a href="/assessment/workflowAssessment/" + $routeParams.accountID + "/" + studentInfo.Student.StudentID + "/" + studentInfo.WorkflowAssessmentVersionID">link</a>';

And I get the error: the sanitizer was unable to parse the following block of html <a href="/assessment/workflowAssessment/" + $routeParams.accountID + "/" + studentInfo.Student.StudentID + "/" + studentInfo.WorkflowAssessmentVersionID">link</a>

I'm not quite sure what I'm missing to get this working.

Thanks for any help!

来源:https://stackoverflow.com/questions/32911537/angular-ui-bootstrap-implementing-html-in-popover-using-popover-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!