17
votes
2answers
11k views

AngularJS - multiple ng-click - event bubbling

In the following example: <li ng-repeat="item in items" ng-click="showItem(item)"> <h3>{{item.title}}</h3> <button ng-click="remove(item)">Remove</button> ...
4
votes
3answers
3k views

Ng-click doesn't work inside ng-repeat

Ng-click doesn't work from inside ng-repeat. Outside it works. I've put a fiddle here <div ng-controller="MyCtrl"> <a ng-click="triggerTitle='This works!'">test</a> ...
3
votes
1answer
3k views

AngularJS - ngSwitch and ngClick not working in ngRepeat

I want to display the elements of a list thanks to a ngSwitch but I can't figure out how to do with a ngRepeat. I've begun by doing it without a list, just to understand how ngSwitch works and to show ...
2
votes
2answers
84 views

How can I change ng-click behavior for a single element in an ng-repeat?

I am refactoring a table written in angular. Currently ng-repeat is used to create multiple tables rows, any of which will redirect to a given ui-sref when clicked upon: <tbody> ...
1
vote
1answer
2k views

Injecting a HTML template to DOM on click the clean way (Create an instance of a class)?

In my AngularJS project I have something like this (it's a dropdown menu with customer names. With a click on one of the names a Scrum Card should appear with the customer's names inserted in the ...
1
vote
2answers
2k views

Button inside ng-repeat to update input in form

What I am trying to do is update an input field from within an ng-repeat. I have an ng-click on the button inside the ng-repeat for each user. When clicking on the button it should update the value of ...
1
vote
2answers
667 views

Triggering a function with ngClick within ngTransclude

I have an unordered list loaded with four items from an array while using ngRepeat. The anchor tag in the list item has a function in the ngClick attribute that fires up a message. The function call ...
1
vote
2answers
390 views

AngularJS Accordion Expand All Collapse All

I am trying to get the accordions to toggle correctly through the directive ng-click. If I have Item one open how do I get it to expand all the accordions? Item two and Item three will continue to ...
1
vote
1answer
250 views

AngularJS - Using a custom filter and ngClick to update same ng-repeat

I have a simple ng-repeat. The ng-reapeat can be populated in 2 ways, firstly by typing a value and clicking the Submit button, secondly, entering values and the list automatically updates. The issue ...
1
vote
1answer
135 views

ng-repeat ng-click when the click function has already been called earlier in the code

First off, I read the plethora of other questions and answers regarding ng-click, ng-repeat, and child and parent scopes (especially this excellent one.) I think my problem is new. I'm trying to ...
1
vote
1answer
188 views

Combine ng-repeat and ng-click

I am building an angularJS app using ng-repeat and ng-click on the same element. I have an array of items which I run through to create a list of buttons. Each one of these items has a property ...
1
vote
1answer
642 views

AngularJS - IE8 - Passing $index to a function within ng-click always return 0 and is executed multiple times

I'm experiencing the following issue. consider this code: <div ng-repeat element in elements> <input type="text"/><a ng-click="deleteTag(inputArray, $index)" ...
0
votes
2answers
1k views

jQuery not working with ng-repeat results

I am using ng-repeat to build an accordion using jQuery and TB. For some reason, this is working perfectly when hardcoded but fails to trigger on click when inside of the ng-repeat directive. I was ...
0
votes
3answers
128 views

AngularJS Trying to use ng-click with ng-switch but ng-switch is not switching my divs

AngNoob here. I have some global navigation that uses the routeProvider to swap out external html pages inside the view. Within the view i set up a list type sub navigation (created with ng-repeat) ...
0
votes
3answers
75 views

Removing Class from all children except clicked child on ng-click in Angular

I have a simple list item being parsed with ng-repeat: <ul> <li ng-repeat="item in items" class="commonClass" ng-class="{'on': on_var}" ng-click="on_var=!on_var"> ...
0
votes
1answer
465 views

AngularJS - ng-click does not remove previous click's modifications when clicked again

So I am trying to acomplish this example: http://jsfiddle.net/pkozlowski_opensource/WXJ3p/15/ However, for some reason, when I click on one div, and then on another, it does not remove the "active" ...
0
votes
2answers
35 views

ng-change not firing but ng-click does in ng-repeat

I have a couple of arrays and am looping through them to build a table. The first header row is an array of column names and the second a row of select boxes that the user will use to select to map to ...
0
votes
3answers
68 views

Remove click event on last item in ng-repeat

I have an ng-repeat which looks like the following: <ol> <li class="pointer node-name" ng-click="myClick(node)" ng-repeat="node in myArray">{{node.name}}</li> </ol> This ...
0
votes
1answer
145 views

How do you toggle an active state ng-class in an ng-repeat item using ng-click?

<ul> <li data-ng-repeat="image in images" data-ng-click="toggle = !toggle" data-ng-init="toggle=false"> <img data-ng-class="{'active' : toggle}" src="" /> </li> ...
0
votes
1answer
59 views

Data Binding not passing correctly to controller function parameter inside ng-repeat

I am building a menu to allow users to change CSS on my webapp. My js method takes a string and then adds it into a URI for a bootswatch CDN. The code works when I hardcode a string. When I use the ...
0
votes
1answer
34 views

How do I assign a unique controller to $last in AngularJS?

First, I'm new to AngularJS, so please bear with me. I have been reading the documentation and working through some online tutorials to try to get at least the basics down, but this particular matter ...
0
votes
1answer
222 views

ngClick not firing in nested ngRepeat filled with data from $http.post()

I have an AngularJS app to search for journeys. In the part of the problem I am trying to show all available countries per region. The idea is that when you click a country, a function has to be ...
0
votes
2answers
859 views

Ng-click built inside Ng-Repeat - not fires its function in chrome, works in FF

This code works great with FF. It fires up the updateModels funcion. But, In Chrome it doesn't do anything.... $scope.updateModels = function(model_id,option_txt,option_idx){ console.log('do ...
0
votes
1answer
22 views

how to show exact content of ng-repeat using ng-click in angularjs

I am trying to show exact content when I click on data from ng-repeat. <div ng-repeat="trailSpot in trail.wayPoints"> <a ng-click="viewState.showSpotDetails = ...
0
votes
1answer
46 views

ng-repeat, ng-click, directive, and controller interaction

I have this directive snippet: return { scope: {}, restrict: 'E', templateUrl: 'partials/order_table.html', controller: 'OrderController as x', link : ...
0
votes
0answers
58 views

AngularJS - ngclick on 2 clicks not working

I am trying to implement a simple ng-click for when a user clicks on a link in the first instance something is shown, in the second instance, the same thing that was shown is now hidden. Here is my ...
0
votes
1answer
161 views

AngularJS - Issue appending HTML to single item in ng-repeat

THE SITUATION: I am exploring AngularJS by re-building a former project with it. I am using the angularjs-rails gem version 1.2.16. I have a page were I make an API call that returns an array of ...
0
votes
1answer
161 views

Angular: ng-click only on subset of elements inside a ng-repeat

I'm using Angular; I have have an ng-repeat loop where I'd like to make some elements clickable. Something like the following: <div ng-repeat="item in itemList"> <span ng-class="{ ...
0
votes
0answers
242 views

Two ng-repeat, $index not sending the right value in the second ng-click

I have two ng-repeat that follow each other in the same directive: <section slider class="slider"> <nav> <ul> <li ng-repeat="slide in slider[0]" ...
-1
votes
3answers
195 views

ng-repeat passing index value to a function

I need to pass a $index value of a specific element, added with ng-repeat, to a javascript function. My code sample: <tr ng-repeat="cells in CouponsList.CellPhones"> <td><button ...