0

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!

4
  • Does this answer helps?
    – Michel
    CommentedOct 2, 2015 at 16:23
  • Well, the link has to be dynamic. If the link is stored in a template, how do I pass variables to it?CommentedOct 2, 2015 at 16:27
  • The popover has the same scope as the one where the glyphicon-info-sign is. There is no problem to have a dynamic link based on studentInfo in the popover template.
    – Michel
    CommentedOct 2, 2015 at 16:59
  • Your problem has nothing to do with the popover, per se, but rather your href value. Try building it up before you pass to href. Note that you may also need to use the $sce service.
    – icfantv
    CommentedOct 6, 2015 at 20:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.