Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8629581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:50:47+00:00 2026-06-12T08:50:47+00:00

I am trying to create a popover to confirm a delete operation. I create

  • 0

I am trying to create a popover to confirm a delete operation. I create the popover using the clickover bootstrap plugin (3rd party) and created a directive.

The problem is that I am not being able to access the parent/sibling scope from the compiled html for the popover buttons.

In pratical terms, what this code is not doing is to call the destroy function in the scope with the iteration variable (v) from the delete button in the popover.

JSFiddle:

http://jsfiddle.net/maralc/PCB2D/

Bellow is the code for the directive:

function TestCtrl($scope) {
    $scope.list = {
         id: [{
             value: 1},
         {
             value: 2},
         {
             value: 3}]
     };
     $scope.destroy = function(id) {
         console.log("destroy called (" + id + ")");
     }
 }

 angular.module('TestApp', []).directive('buttonDelete', function($compile, $rootScope)      {
     return {
         restrict: 'E',
         replace: true,
         template: '<a class="button-delete"><i style="margin-top: 4px;" class="icon-     remove"></i></a>',
    link: function(scope, element, attrs) {
        //            debugger;
        //element.bind('click', function(e) {
        //                var popover = $();
        //                element.clickover({content: 'test'});
        element.clickover({
            global: true,
            title: 'Are you sure?',
            content: function() {
                //debugger;
                var element = $compile("<div class='btn-toolbar'><button id='button-confirm-delete-cancel' data-dismiss='clickover' class='btn'>Cancel</button><button id='button-confirm-delete-ok' class='btn btn-danger' ng-click='destroy(v)'>Delete</button></div>")(scope.$parent);
                return element.html();
            }
            //});
        });
    }
}
});​
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:50:48+00:00Added an answer on June 12, 2026 at 8:50 am

    It looks like it’s working for me… v is an object not an index, such as:

    {value: 2}
    

    So from your destroy function just do id.value to get the id. Or I’d suggest updating your repeat expression to:

    v.id in list.id
    

    Or rename from ID, it’s confusing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a Bootstrap popover on a TextBox from GWT. <a
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create a generic video plugin for Expression Engine 2 where I can
I'm trying create a log specifically for logging user account activity. I created this
All, I am trying create a 'to & fro' animation using jquery animate &
I'm trying create a gui using Tkinter that grabs a username and password and
How can I create special popOver? I have manually created a new class, with
hi I'm trying create chat using node.js I see example in http://chat.nodejs.org/ I have
I'm trying create an executable for Windows for a GUI application in tkinter using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.