angular-ui-bootstrap: Implementing html in popover

2019-09-20 07:12发布

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!

0条回答
登录 后发表回答