-1
votes
0answers
22 views

How to add ng-click directive to dom element in java script

I have a Button which is being included in the page via jsp include . <button class="btnGreyInactive" name="btn_createNew" id="createNewBtn" style="display: inline-block;" ...
0
votes
2answers
40 views

Toggle between input and textarea, but only if the text is long

My goal here is to show a textarea every time when the user click in the input and its content length is greater than 20, if not I keep showing the normal input. I don't know what is missing in my ...
0
votes
1answer
26 views

How do I use predefined directives (ng-click) with custom directives in a nested fashion?

How do I ng-click to work for the button in ngSearchBar.html? I want to use the same scope as my parent directive (ngSearchBar.html) for my child directive (ng-click), so that I can do scope.search = ...
0
votes
1answer
55 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 : ...
1
vote
1answer
90 views

Adding and removing a class from parent div AngularJS

I have 3 boxes each with it's own button. The button is used to collapse it's parent div by adding a class of 'collapsed' to the parent. I have go the classes being added but I need to get them ...
0
votes
0answers
85 views

angularjs ajax call wrapped by $scope.$apply function preventing ng-click from being executed

I have and custom validation directive which triggers on change to validate user input: link: function(scope, elem, attrs) { elem.on('change', function() {$scope.$apply(function(){ ...
0
votes
1answer
18 views

Show form using custom directive - AngularJS

I have a button with ng-click function. When I click the button, it should show the form which is coded in a templateUrl using a custom directive. Which function should I use to get the screen ...
1
vote
1answer
345 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
0answers
47 views

AngularJS - JSON and return all results

I'm trying to write a basic search function using AngularJS. I have written a service that finds my JSON file and binds it to a $scope object $scope.SearchResult What i am trying to do it perform a ...
0
votes
1answer
371 views

Ng Table Pager template is not allowing any custom data binding like ng-click=“Custom Function”

first I have used a ng table pager template I am not able to use my custom function like ng-click='first()' instead of ng-click="params.page(page.number)" and then call the parameter inside it's ...
1
vote
2answers
504 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
2answers
62 views

ng-click loose the function context

I am using angularjs. I have a directive that gets a function as parameter: module.directive('someDirective', [function () { return { restrict: 'E', template: <button ...
0
votes
0answers
61 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
2answers
220 views

AngularJS - accessing ng-click in custom directive

I'm trying to get my head around directives, i can easily use the template function to throw out my HTML, however, if i have an ng-click within my template, how can i access it within the link ...
0
votes
2answers
77 views

Why are mouse events from my directive not reflected in the view?

Here is an example fiddle. Please open the console first. It's a little long, so to quickly explain: You'll see two divs. One is "regular", the other is created via a directive. They both have ...
0
votes
1answer
109 views

AngularJS - Binding 'click' to directive

I'm currently working on a simple module to display notifications to the user in the form of toasts, or popups, that appear in the lower right-hand corner of the screen. The following directive works ...
2
votes
2answers
344 views

Why does ng-click=“test()” not work but onclick=“angular.element(this).scope().test()” does?

I have defined an angularjs directive as follows: jtApp.directive("jtWizardPage", [function () { return { require: ["^ngController", "^jtWizard"], restrict: "E", replace: ...
0
votes
1answer
177 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 ...
1
vote
2answers
316 views

How to invoke ng-click from a directive partial?

I have a directive that has a local scope where a partial contains ng-click. The Fiddle is there: http://jsfiddle.net/stephanedeluca/QRZFs/13/ Unfortunatelly, since I moved my code to the directive, ...
1
vote
0answers
129 views

Disable ng-click on certain conditions of application for all types of element

In my application I've binded several elements with ng-click directive like below <a ng-click="DoSomething()"/> <button ng-click="DoSomethingElse()">xyz</button> <span ...
0
votes
0answers
127 views

Fire directive, refresh, & pass parameter on ng-click

tldr; I need to fire a custom directive/jQuery plugin on ng-click and pass a parameter to it then reload that page so the parameter's value takes place. So on reload instead of there being 3 results ...
0
votes
0answers
218 views

Why does using Angularjs ng-click, to call directives method($event) leads to Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting

I tried to write an custom map directive for an Phonegap + Angular OpenSource project you can find here: https://github.com/MariusSchmidt/Schreibwerkstatt/tree/Bettermap. My problem is, that when I ...
0
votes
0answers
958 views

AngularJS, data-ng-click not triggering function, and routing only showing up on firefox, not IE or chrome

I am doing tutorials on AngularJS, and I'm having two problems. First, I have code that is showing a page on Firefox, but not on IE or Chrome, and data-ng-click is not triggering any function: here is ...
0
votes
0answers
246 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]" ...
6
votes
4answers
7k views

Automatically pass $event with ng-click?

I know that I can get access to the click event from ng-click if I pass in the $event object like so: <button ng-click="myFunction($event)">Give me the $event</button> function ...
1
vote
1answer
42 views

Attempting to pass an expression as an argument to a directive. Being taken literally instead of value

I'm trying to pass the value from an that is displayed through an ng-repeat into a function in my controller. The value displays properly in the HTML but when I get over to the function it displays ...
1
vote
2answers
682 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 ...
6
votes
2answers
4k views

Handling ng-click and ng-dblclick on the same element with AngularJS

I was looking for both single and double-click event handling with AngularJS, since AngularJS always fires only the ng-click event even if there is ng-dblclick directive set for our element. Here is ...
0
votes
0answers
164 views

ng-click="show… not working in directive

For the life of me I can't get ng-click="show''" to work in the directive correctly. HTML <sortable ng-controller="SortableCtrl"></sortable> <div ...
0
votes
3answers
520 views

What element raised ng-click in custom directive ng-repeater

I have a repeater inside of a directive that spits out table rows. When a user clicks on a row I want to highlight that row. I have something that works, I was just wondering if there was a better ...
4
votes
1answer
228 views

ngClick does not fire in recursive template

I developed a classic recursive menu and it build itself fine. Problem is that ngClick is never fired from the elements of the recursive directive. I know it's a problem of scope and I tried many ...
0
votes
2answers
544 views

ngClick on anchor tags causing problems in Angular

I've got ngClick directives on the anchors tags inside my main navigation, to make the menu "disappear" off canvas after clicking it: <a href="/#/profile" ng-click="showNav = false"> It's ...
1
vote
0answers
367 views

Unbind ng-click for dynamic dom element in angular

I have a dynamic div which is conditionally pushed into the dom. I have an ng-click event bound to a child element inside the div which fires myfunc() . Now when that div is removed and re-added to ...
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 ...
4
votes
2answers
4k views

AngularJS - how to override directive ngClick

I want to override directive ng-click: to some make some $rootscope changes before each execution of ng-click. How to do it?
9
votes
1answer
1k views

Decorating the ng-click directive in AngularJs

I've been looking into modifying the AngularJS ng-click directive to add some additional features. I have a few different ideas of what to use it for, but a simple one is to add Google Analytics ...
2
votes
2answers
11k views

Angular Directive ng-click Not Working

Plunker I have an external controller that contains a directive inside of its view. The directive gets a list of process points and generates links where you can select each one. It correctly sets ...
0
votes
2answers
2k views

Bind ng-click function in compile with AngularJS

When we try to add an ng-click function (linked to a controller action) onto an element during the compile phase, it is not working. We can get it working if it is in the link function, but as we ...