Angular -ui-bootstrap: html implementation in popover using popover-html

I am trying to implement a popover to activate when clicking a glyphicon. Inside the popover, I want to show a link to go to a new page.

I am on angular -ui version 0.13.4.

I found: Angularjs ui bootstrap - put the html inside a popover , so I'm trying to do something like this.

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>'; }

A link will appear, but nothing happens when I click.

I 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 am missing to get this to work.

Thanks for any help!

0
source share

Source: https://habr.com/ru/post/1610034/


All Articles