2012-08-14 5 views

Respuesta

5

Una manera de hacerlo es con sólo hacer referencia office en el ui-options como this fiddle:

<div ng-repeat="office in offices"> 
    <a href="" ui-jq="popover" ui-options="{title:office.location, content:office.people.join(',')}">Test Popover - {{office.location}}</a>  
</div>  

Otra forma de hacerlo es generar el ui-options a través de una función que pase el elemento actual dentro de él como this fiddle.

Con este fragmento de HTML:

<div ng-repeat="office in offices"> 
    <a href="" ui-jq="popover" ui-options="popoverOptions(office)">Test Popover - {{office.location}}</a>  
</div> 

Y el código del controlador:

$scope.offices = [ 
    {location:'Europe', people:['andy','gloopy']}, 
    {location:'USA', people:['shaun','teri']}, 
    {location:'Asia', people:['ryu','bison']}]; 

$scope.popoverOptions = function(office){ 
    return { title: office.location, 
      content: office.people.join(',') }; 
}