0

I have a problem on AngularJS, I have this service

GetLastPhase.get({ 
         campaign_id: $stateParams.id,
         lead_id : id, 
         relations: 'lead,workflow,tickets'
     },
     function (response) {
         $scope.phaseDetails = response;
     });

but when I call this service in HTML, I don't want to repeat the button add, do you have any solution how to ignore ng-repeat or how to send this leadTicket.id parameter in another way

div(ng-show="wizard.active(3)")
    .col-md-12
    .crm-extend-add
    a(ng-click="add(leadTicket.id)", ng-controller="CampaignTicketCtrl") {{ 'Add Ticket' | translate }}
    .col-md-12.crm-form-group(ng-repeat="leadTicket in phaseDetails")
    .crm-repeat(ng-repeat="ticket in leadTicket.tickets")
        | This
        a  {{ leadTicket.id }}
        |  was created for 
        a(href='#') {{ leadTicket.lead.first_name }}
        |  at {{ leadTicket.workflow.name }}
    .crm-expand-divider
Waleed Iqbal
  • 1,308
  • 19
  • 35
  • For you information, the word "I" is always written in capital letter in English. And for your problem, how do you call the JavaScript function you've shown? – Blackhole Jul 14 '15 at 18:56
  • You're saying that you only want one add button, outside of the ng-repeat? You'd have to have some way for the user to determine which element they're adding. – chrisvans Jul 14 '15 at 19:21
  • I didn't understood your problem, but it seems like you want to use ng-if. Here is a link to other question showing how it works. http://stackoverflow.com/questions/21751676/using-ng-if-inside-ng-repeat – gmartini20 Jul 14 '15 at 20:54

0 Answers0