javascript - angular.js template variables to bootbox dialog? -


I'm trying to figure this out for 10 hours like this. Time to ask for help!

I get a value to an angular. Trying to pass in the bootbox for a nice looking confirmation signal from the Js template variable.

Let's say I have the following (brief for clarity):

  & lt; Script & gt; $ (Document) .on ("click", ".confirm", (function (e) {e.preventDefault (); bootbox.confirm ("this {{item.name}} needs to be value", function (Confirmation) {console.log ("confirmation:" + confirmation);});})); & Lt; / Script & gt;   

which is executed as follows:

  & lt; ul class = "list-group" & gt; & Lt; Li ng-repeat = "item in item" & gt; & Lt; a href = "" class = "confirm" & gt; & Lt; span class = "glyphicon glyphicon-fire red" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; / li & gt; & Lt; / Ul & gt;   

When the user clicks on the link, I'll see a confirmation box, and I must include features like {{item.name}} and {{item.row}} . Which are specific to this element in the list.

I have read the $ compile functionality of angular.js and give it a & lt; Div compile = name "& gt; but it does not help me recover a single entry from my list because I am waiting. Any help would be appreciated!

Applies as command ...

HTML: ng-app = "myApp" ng-controller = "MainController">

  • NG-repeat = "Items in item" & gt; & lt; Confirmation-Button name = "{{item.name}}" & gt; & lt; / Confirm-button & gt; & lt; / li & gt; & lt; / Ul & gt; & lt; / Body> JS:
      angular module ('myApp', []). Main controller ', function $ scope) {$ scope.items = [{name:' one '}, {name:' two '}, {name:' three '}];}). Directive (' confirmButton ', function () {return {limited: 'e', ​​radius: {name: '@'}, template: '& lt; a href = "#" class = "confirm">   



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -