html - Display a div for a particular element in AngularJS's ng-repeat loop -


I have the HTML code in which the angiaries with the div is SG ng-double. What I want to do, shows the division that says, "You have already voted for this review" for only that particular element for which div [id = "arrow_up"] is clicked. This code displays the code "You have to .. .." once click for all the elements of the loop, apart from this, the requirement is to go to this device after 5 seconds intervals.

  & lt; div class = "col-xs-4" ng-repeat = "review in date_reviews $ track by index" & gt; & Lt; Div id = "arrow_up" class = "arrow-up" ng-mouseover = "message_up = true" ng-mouseleave = "message_up = false" ng-click = "save ovate (review [0] .review_id, 1, $ index) ; "Ng-square =" {vot_capture_top: voted and index $ == selected index} "& gt; & Lt; / Div & gt; & Lt; div ng-show = "voted_msg_up" ng-class = "{message: $ index == selected index}" & gt; You have already voted for this review & lt; / Div & gt; & Lt; div class = "message" ng-show = "message_up" & gt; This review is useful. & Lt; / Div & gt; & Lt; / Div & gt;    $ scope.saveVote = function (review_id, type, index) {console.log (review_id)   

Below is a saveVote function from the controller. Email = $ cookies.email; Console.log (type) console.log (index) $ http ({method: 'POST', url: '/ saveVote', data: {"review_id": review_id, "vote_type"), type "emailId": $ cookies .email,}, Header: {'Content-type': 'Application / x-www-form-urlencoded'} // set the header so that angular pass information form data (request no payload)}) . Success (work (data, position, header, config) {$ scope.selectedIndex = index; if (data == "already exists") {$ scope.voted_up = false; $ scope.voted_down = false; $ scope. IsDisabled = true; if (type == 1) {$ scope.voted_msg_up = true; $ scope.voted_msg_down = false; console.log ($ scope.voted_msg_up) console.log ($ scope.voted_msg_down)} and {$ scope. voted_msg_up = false; $ scope (data == "success") {if (type == 1) {$ scope.voted_up = true} else {$ scope.voted_down = true}}} error. (Function (data, position, header, config) {$ scope.status = status; $ window.alert ("error")}); }

Thanks in advance.

Creates the following elements and div for that particular element.

  & lt; div ng-show = "voted_msg_up and $ index == selectedIndex" & gt; You have already voted for this review & lt; / Div & gt;   

But how to remove the device after 5seconds is still not known.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -