The `ngClick` directive allows you to specify custom behavior when element is clicked.

learn more… | top users | synonyms

0
votes
4answers
38 views

Adding parameters to ng-click in Angular JS

My code is something like this In View HTML : <div ng-app="myApp" ng-controller="myCtrl"> <button ng-click="get_user_detail(Andrew)"> </button> <button ng-click="...
1
vote
1answer
18 views

Ng-click not working dragula drag-drop elements

Using dragula plugin (Angular 1) link ng-click not working moved (drag and drop to another ul) on li element <ul dragula='"second-bag"'> <li ng-click="fun()">Item One </li> &...
1
vote
2answers
35 views

Prevent execution of two directive expressions

I've got this html <nav ng-init="items = false"> <ul class="main-items"> <li><a ng-click="..."></a></li> <li><a ng-click="..."></...
0
votes
0answers
39 views

Angular two forms, two ng-click, same function, only the first one runs

I have two forms on a page. The first adds an item to the database, and the second is prepopulated with the data and allows the user to modify the item. The first form allows the user to create and ...
1
vote
2answers
29 views

Hide previous content on second click of the button of any loop inside ng repeat

I have a ng-show inside ng repeat. Whenever i click the comment button it shows the div tag contains comment box which shows previous comments of that list. The actual problem is when i click one ...
0
votes
2answers
54 views

ng-repeat ng-click showing only last value from an array

I am trying to show the details of each of my values from my data in a pop up window however, only last value from an array is shown three times instead of three different values. This is my html: ...
1
vote
1answer
18 views

Angular get CSV file in browser by calling URL

I have made a Java micro service to export a table from a database into a CSV file and get it in browser by following this: Downloading a CSV File in Browser by using Java It works well and I get the ...
1
vote
2answers
22 views

Ternary condition in ng-click angular js

In HTML I have a button and I am using ng-click event on it, like this: ng-click="!user.name : openModel('lg') ? ''" I am saying if user.name is not defined then call the function called openModel() ...
1
vote
1answer
23 views

AngularJS model update reverting back to original

http://plnkr.co/edit/3UMwSK6H5VL0pZujL7Qh?p=preview Click edit and then cancel. The text boxes do not go away. Click cancel again, they go away. Please tell me why this is happening. I am losing my ...
0
votes
1answer
52 views

Printing what is inside a modal

I have a modal where I want to print the full contents of it. I don't want anything else printed aside what is within the modal. Here I created the button within the modal: This should not be ...
1
vote
2answers
43 views

Angular ng-class via ng-click inside ng-repeat

Edit: The answers below haven't taken into account the +1 function that is also being applied. Still looking for how I can make both happen. I have an ng-click function that is called on a button ...
0
votes
1answer
16 views

How to use Angular ng-click function to only add 1

I have this function in my Angular controller but I only want the user to be able to add 1 heart, and if they click again, it would remove the heart. How can this be accomplished? $scope.activeClass =...
0
votes
0answers
17 views

Selenium + Python: simulate clicking on angular elements

I'd like to automatize downloading some csv reports from iTunes AppAnalytics, using Python with Selenium WebDriver. In normal way I'm clicking on the download icon and then I get my file, here's the ...
0
votes
1answer
24 views

AngularJS - ng-click + ng-touch not working properly on mobile

I have both ng-click and ng-touch on a button used for search. On desktop the search and the functions called in ng-click work properly. On mobile on the other side the search button stops working ...
0
votes
1answer
43 views

Use directive or ng-click to change preview in AngularJS [closed]

So I'm very new to angularjs and have written a function in js that I would like to figure out how to convert to I guess a directive. I have an image library using ng-repeat to load a series of ...
3
votes
0answers
42 views

Understanding the working of ngClick and ngDblclick

I was trying to figure out how ngClick and ngDblclick work in angularjs. The problem is that even while clicking twice, instead of calling doubleclick function once. Angular calls click function twice ...
1
vote
1answer
34 views

Bootstrap Modal: Content from html page does not show within the modal

I have a created a button when you click it a modal appears. Here is the code: <li style="float: right;"> <button id="myBtn" data-target="#myModal" ng-click="printDivModal('rollup-tab')"...
1
vote
3answers
51 views

Creating a button that shows a modal in AngularJS using UIBootstrap

On my html page (rollup.html), I have a button.. <li style="float: right;"> <button id="myBtn" ng-click="printDivModal('rollup-tab')">Modal Test</button> </li> and I want ...
0
votes
1answer
56 views

How to handle ng- click() with argument in a Protractor

Code line: ng-click="my.Update(Profile)" Now how will I locate this element in protractor?
0
votes
2answers
49 views

Toggle two classes with AngularJS / jqLite on click

I wan't to get a slideIn / slideOut animation by toggling the classes slideInRight and slideOutRight to a ul element. I've tried it in different ways but I it only works with one className. How ...
0
votes
1answer
34 views

AngulaJs: ng-click not work on netsted uib-accordion

I use nested uib-accordion, and I want add ng-click to each of uib-accordion. <uib-accordion close-others="oneAtATime1"> <div uib-accordion-group class="panel-default" is-...
0
votes
1answer
55 views

ng-click gives “href undefined ” error on a function call with a parameter

After seeing multiple issues around this, I'm still unable to figure out why the error occurred. Here is my code so far: app.js myApp.controller("myController", function($scope, $window) { $...
2
votes
1answer
30 views

Unable to call ng-click on function inside the link function

I have a directive..i want to use a function defined inside the link function of the directive in the place where i have defined the template of my directive app.js angular.module('app',[]) ....
0
votes
1answer
20 views

ng-click works only after filtering by typing into a field

I want to add to dir Paginate control filtering. <tr dir-paginate="advert in adverts |orderBy:propertyName:reverse | filter: searchAdvert | itemsPerPage: pageSize"> I have categoryId ...
0
votes
3answers
38 views

Shortcut if within ng-click without else

I tried to find an answer to my question, but nothing helped me really. What I need is a shortcut if within a ng-click without an else expression, just with an if condition and what happens if this ...
2
votes
2answers
71 views

Angular: Why is my div not showing/hiding with ng-show/ng-hide?

I'm trying to make a super simple lightbox for some images. Basically I have a div with a set of images showing up using ng-repeat, and I want to have a lightbox div show up when one of the images is ...
0
votes
1answer
43 views

function end before angularjs promise resolve

$scope.clickfunction = function(arg){ var url =""; var httppromise = $scope.promiseufunction(arg); // return a http promise httppromise.then(function(res){ if(res){ url ="path/" ...
0
votes
2answers
37 views

Not able to change path using $location service even after using $scope.apply

I am wondering why I am not able to change my view using location service even after I use - $scope.$appy() or $scope.apply; I did research before posting my question. I got results of similar ...
1
vote
0answers
29 views

ng-click and ngRouting on mobile devices

I am completely new to Angularjs and haven’t been doing any code for ages. I started setting up my website again with Angularjs. I have a main page and an about page, to which the user gets via ...
1
vote
1answer
25 views

Change property for every value in ng-repeat

You can see in my fiddle that the value for each name is set to 0. I'd like my changeAllValues() to change all the value: 0's to be value: 1's! What is the best way to do this? JS Fiddle: ...
0
votes
2answers
49 views

How to send Angular JS scope variable as a complete object on ng-click as a parameter to a function?

I'm trying to pass a complete repeat object data as a parameter through ng-click function. like : getImages($index,award) "{ "piaKey": 3, "etc": "etc.." }" HTML <div ng-repeat="award in ...
8
votes
1answer
74 views

Ionic triggers unwanted ng-click on right click and middle click

I am using Ionic in the latest Chrome Version and Chrome canary for some very ODD reason Right click causes ng-click to trigger. Code Pen demonstrating the issue any one can shed some light ?
0
votes
3answers
24 views

Add a border style on click along with adding item to cart

I am trying to add a border to a div that houses my product. I want it to work together with the ng-click I already have that adds the product to the cart. So, when a user clicks the 'select' button a ...
0
votes
2answers
97 views

ng-click inside ng-repeat not working

I am using routeProvider to route to "views/userspace.html" which uses "UserspaceController" The "views/userspace.html" recognizes this controller and makes request a $http request. This request ...
0
votes
1answer
27 views

Toggle click function on list of items in AngularJS (iframe)

So I have the below work-flow: I've got a list of items each having an ng-click event which opens an iframe below the item clicked. Now, On clicking an item of the list, a div tag below that item ...
0
votes
2answers
33 views

How to Open Large Data using ng-href or ng-click in new window in AngularJS [duplicate]

Can some one help me putting the DATA value new window . I want to make td cell with DATA name as hyperlink . If I click that DATA it should open new window to show the value . Demo JSON Data { "...
0
votes
1answer
31 views

I have a button inside a DIV. I'm using ng-click to open two modal. One modal open when click on the DIV and other by button

I have a button inside a DIV. I'm using ng-click to open two modal. One modal open when click on the DIV and other by button.While clicking DIV modal open fine, but when i click button both the modals ...
0
votes
0answers
44 views

Raise anchor ng-click on enter keypress for accessibility in angular

I am working on a problem for accessibility issues in my project. One scenario I am struggling is, we have anchor tag with ng-click event. When someone is hitting tab and reached anchor tag on the ...
0
votes
3answers
134 views

Disable ng-click

I'm trying to disable an ng-click directive. I have this script I call in a kendo grid <script type="text/x-kendo-template" id="PnIssueCell"> <span style="white-space: normal" ng-click="...
0
votes
0answers
58 views

Angularjs ng-click doesn't work inside scope (Firefox only)

I just play around with angularjs and its functions. I simply try to click a button and return a string in console.log. When I click the button, nothing happens even no error message is visible. What ...
-3
votes
3answers
62 views

ng-click is not working on dynamic divs

I am developing an app with angular and i need to insert some data from a webservice. I create the divs dynamically: for(var i = 0 ; i < data.Output.length ; i++){ var listitem = ...
0
votes
2answers
28 views

Comparing objects from two scopes to provide a value

I'll try to simplify the problem as much as I can. Let's say I have 2 scopes $scope.section1 = [ {label: 'label1'}, {label: 'label2'} ]; $scope.section2 = [ {value: 'one'}, {value: 'two} ];...
0
votes
1answer
63 views

Is it possible to invoke a component on ng-click?

Previously there was a <div>, the contents of which i was toggling on ng-click. With components in Angular 1.5, i moved the contents of the <div>and created a component. I want to load ...
0
votes
1answer
53 views

Why ng-click not working in the example

I can see that on clicking the control not going to controller by chrome debugger. I have simple code in view and controller. Also, I am not getting any error. Any help would be appreciated. View &...
0
votes
2answers
53 views

auto generate download link with angularjs

i generate my download link from this script https://github.com/joshpangell/single-use for example: download url generated like this: http://cloud.joshpangell.com/singleuse/download.php?key=...
1
vote
1answer
45 views

ng-click does not fire in or out of ng-table

How do you get the ng-click event to actually fire? I've tried everything to get this to work. I know the alert is working initially, but after the list is displayed, quite magically all the buttons ...
1
vote
1answer
74 views

ng-click doesn't work with external JavaScript

I am creating an ionic project and I am trying to integrate with Algolia autocomplete.js. I managed to make the search system work, however I added a ng-click on my search results and this function is ...
2
votes
1answer
55 views

Ng-click filter between 2 scopes

I am new to Angular.js so I am not sure if this is the right approach. I have two scopes that are used to display 2 sets of buttons. The second set should be dependent on the button I click in the ...
0
votes
1answer
28 views

get data from a ngrepeated div to another div on click

<div ng-app="appPage" ng-controller="appController"> <div class="nav"> <h1 class="logo">Todlio</h1> <a href="setting.html"><i class="icon setting" ...
1
vote
1answer
102 views

Angular trigger js 'onclick' event

I'm trying to trigger an 'onclick' event inside of an angular controller. <div id="galerie"> <h2>{{main.Page.title()}}</h2> <hr> <div class="row"> &...