Skip to main content

All Questions

2 votes
1 answer
1k views

Angular custom directive calls function on change of input field

I have a directive that places a file upload input field on the DOM, and I then want the ability to call a function when that file is changed. How can I get an on change function to work without ...
Tori Huang's user avatar
1 vote
1 answer
268 views

Calling an angular directive via append method

I'm trying to call an angular directive with html text I am appending in my controller like so, var loadReviews=function(){ var theDiv=$("#rlist") for(var i=0; i<vm.reviewlistByUpvote.length; ...
Vohn 's user avatar
  • 11
0 votes
1 answer
1k views

Validation the sum of multiple clone Input 100%

Hey guys i'm trying to write a directive that could check the validation of multiple inputs fields which contain numbers as percentage. The directive should be able to check if the sum of all those ...
AnhNguyen's user avatar
2 votes
0 answers
44 views

Get number of directives on page?

Is there a way with angular that we can get the current number of directives on a page before it processes? Currently, I'm using jQuery: function getNumberOfSlots() { var slots = []; $('slot-...
Shannon Hochkins's user avatar
5 votes
1 answer
2k views

A directive to detect $last is not working with ng-if in angular.js

I am working on a news feed page with angular.js and jquery. I am using a directive to detect the last feed to show. when it return scope.$last ==true, I call a function to do some Jquery animation. ...
Wesleywai's user avatar
  • 325
0 votes
1 answer
1k views

How to set value to element in directive template with jQuery

I have some directive and some template in it. angular.module('testModule', []) .directive('testInput', function () { var id = 1; return { restrict: 'E', ...
Valentin Blokhin's user avatar
0 votes
1 answer
491 views

How to add angular js module inside an existing application

I am trying to add an angular JS module inside an already existing code. I'm actually trying to add a new piece of code inside it. The workflow goes like this. When a button is clicked, the JS takes a ...
user3385597's user avatar
0 votes
2 answers
742 views

ng-keydown not working on input field rendered through directive

In my angular view, I am using directive to render an input field and it works fine. But now I required to perform some action on keydown. ng-keydown works fine with the input field I have in my ...
MKB's user avatar
  • 7,617