AngularJS directives are a way to teach HTML new tricks by extending the HTML vocabulary. Directives allow you to manage DOM elements in a declarative pattern, freeing you from low level DOM manipulation tasks.

learn more… | top users | synonyms

0
votes
0answers
7 views

Removing attributes from angular custom directive

I have a custom directive with isolate scope and = bindings that just wraps a control specified in a template and maps attribute values onto it. In order to avoid blank attributes on the wrapped ...
0
votes
1answer
42 views

AngularJS || Ignore ngBlur on element blur when executing other function that does blur

While developing I have encountered an issue of firing blur two times, when i need to fire it only once. Both ng-blur and ng-enter final actions are to make request to database, in our case 2 ...
0
votes
1answer
15 views

How to get updated value for isolated scope using angular directive?

i have a directive that is making xml pretty for browser when first time page loads it gets the string value. but when value change dynamically string is not being updated xml remain same. Any idea ...
0
votes
1answer
23 views

Using Angular, when should I use ng-model as opposed to binding to a property?

I am building a directive that I will be using in several places in my application. It is a combination of a multi-select field and type-ahead. To pass data back and forth to the multi-select portion, ...
0
votes
1answer
25 views

Implementing Keyboard interaction on modal pop up [Angular JS]

I have created a custom component in angular js for a modal pop up. Everything works fine. Now I would like to implement keyboard interaction on this. That is when the Modal pop up shows the message, ...
0
votes
1answer
22 views

route to specified number of views in angularjs

I am in the process of building a mobile web app with AngularJS. The app will allow the user to record the salary and other figures for employees. On the first page the user will select the number of ...
0
votes
2answers
21 views

AngularJs : The code i have written doesn't work and Code in comment works. where am I going wrong. Please Explain

I'm learning AngularJS from W3SCHOOLS, and I am facing this problem over and over again! In the following code uncommentated lines of controller code are written by me and multiple comment lines ...
1
vote
1answer
20 views

UMD pattern for angular directive

I'm looking to open source an angular directive on npm and I'm trying to come up with the most universal pattern for doing so. How's this? I have 3 questions: !function(name, make) { make = make() ...
1
vote
1answer
16 views

How siblings are sharing their scope under following directive structure

I have following directive structure. <test-widget-body> <test-task-list-filter> </test-task-list-filter> <test-task-list> <test-...
0
votes
0answers
3 views

testing external directive script is failing the tests

describe('third directive', function(){ var compile, scope, directiveElem; beforeEach(function () { /* Directive inside the beforEach is working as expected and button is clicked and test is ...
1
vote
2answers
52 views

AngularJs - Custom Directive - Bind modal from the controller

I'm new to angularjs and directives, and I'm actually having troubles with them. I want to create a custom directive to display images in my ionic 1 application. To achieve this, I need to bind an ...
0
votes
1answer
23 views

Scope name is {{currency}}, how to get specific value in view

The scope name is : {{currency}} I coded this in view. the output is: [{"code":"USD","value":"0.00670000"}] I want to get only value USD in front end.
1
vote
3answers
36 views

Unable to load directive dynamically in AngularJS 1.x

I have lots of condition on which I have to change my view dynamically so I need some way in which I just change in my object and view will react to it. I am trying to load directive dynamically ...
0
votes
0answers
14 views

how to wrap a jquery Plugin - jtable.js in a angular directive?

I am trying to wrap jtable in a angularjs directive. But i am not able to run it. its working fine in jquery, Can anybody help me with this? My html code is: <jtable></jtable> My ...
0
votes
1answer
23 views

How to load attribute directive dynamically in angular 1.x

I am trying to load directive dynamically using values in an object. To do that I have tried following : <body ng-app="myApp" ng-controller="myCtrl"> <div {{testDirectiveJson.first}}-...
1
vote
2answers
35 views

In Angular 1.x how can I access controller methods from a custom directive?

I am currently trying to figure out the best way to access two controller methods from within my custom directive. My current code looks like so: Parent Component Template (navMenus.html): <menu-...
1
vote
2answers
40 views

$watch is not working with directive value

So I'm creating directive that will match passwords. I was trying to figure out my own way to do it. And when, finally, I though I had found solution it didn't work. Here is the dricetive code: ...
-2
votes
1answer
35 views

how to upload image when its show 500 error in angularjs

i want upload image but its show below error how to solve this problem, because other format of html working fine ..i want use in angularjs 500 (Internal Server Error) <input type="file" name="...
0
votes
1answer
32 views

AngularJS - Directive to Directive function call

Directive One myApp.directive("myDirective", function ($compile, $rootScope) { var linker = function (scope, element, attrs) { var myEl3 = angular.element(document.querySelector("#...
0
votes
0answers
35 views

Custom 'compile' directive renders ng-repeat multiply times

I am using a custom "compile" directive to render HTML snippets that I push into a div container which is working great. One problem I am having is that it seems like the compile directive gets called ...
0
votes
3answers
24 views

how to call twice nested method in angular 1.x?

My HTML looks like this: Controller HTML: <div ng-controller="Ctrl"> <first-directive></first-directive> </div> first-directive HTML <li> <second-directive>&...
1
vote
3answers
48 views

Why the expression is appearing as it is in AngularJS example?

I've following code : <!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <p>Try to ...
0
votes
0answers
23 views

Angular Advanced Searchbox - Multiple Choice select

I am trying to get this directive to work with multiple select per parameter. For example i want to add to the parameter suggestion a extra attribute (groupValues), which could be like this: { ...
0
votes
1answer
28 views

How to execute Angular ng-click directive inside custom component on enter key press

I have a custom icon component using isolate scope where a user can define what he or she wants to happen on ng-click: <ers-icon name="history" ng-click="ctrl.clickAlert('history')"></ers-...
0
votes
2answers
26 views

Can I use a Directive in the template function?

So this is a simple example i just wrote up for the sake of this question, I'm curious if I'm able to use a directive and pass in an object to the directive's attribute, all in the template, not ...
0
votes
2answers
21 views

How to delay the google autoComplete function to save credit

As you know every time when we type the google map autoComplete will fire, I want to set a delay function for this, such as 250ms,so give user more time to type and also save the credits. I try to add ...
2
votes
4answers
46 views

Remove DOM-Element with AngularJS

I'm trying to remove a navbar based on the current location path. This is what I have so far: angular.module('myModule') .controller('MainController', function ($location, $document) { if ($...
0
votes
1answer
34 views

how can I pass 'scope' argument outside the directive

how can I pass 'scope' argument outside the directive? i need use it in some other component.. my code: (function () { angular.module('dmv.shared.components'). directive('doImportPackage', ['...
0
votes
0answers
29 views

How to append the same template twice within another template - Angular 1.5

I am an Angular newbie. Using Angular 1.5, I have a main template with a button. ui-sref on the button is linked with a ui-router that loads an image (another template). My requirement is to keep ...
0
votes
0answers
20 views

Angular isolate scope confusions - functions are undefined

I'm trying to create a tree-like structure with angular directives: profileApp.directive('adminList', function() { return { restrict: 'E', replace: true, scope: { ...
0
votes
0answers
9 views

Requiring sibling directives to be initialized sequentially

I am trying to create a modal which has "pages" (each page is a "step" and there is a distinct order). Each page is defined by a directive with it's own controller and template. I want the modal to be ...
0
votes
0answers
24 views

jquery created div to angular directive

I have this basic jQuery function that I am looking at creating as an Angular directive so that I can pass information the angular way. Any help on how to Angularize this would be great. I am ...
0
votes
0answers
24 views

How to pass data between main.js/components and directive?

I need to know how to pass data between main and directory. What I want to do is to active the directive automatically when main.js start on load. Directive code: angular.module('dmv.shared....
0
votes
1answer
44 views

Select option goes beyond display

i am using select tag to show a dropdown. in option tag i am doing ng-repeat. if in that ng-repeat, there is a long string suppose of maxlength=255, how can i break into lines. because it ...
1
vote
2answers
30 views

Filter not working in ng-repeat angularjs

Does anyone know how to filter in ng-repeat, the code is below. I want to filter with profile.full_name. <tr ng-repeat="job in customerjobhistoryCtrl.Jobs | filter:{customer.full_name: Profile....
0
votes
1answer
24 views

How to pass data between main.js and directory?

i need to know how to pass data between main and directory. what I wanna do is to active the directive automaticly when main.js start on load. directive code: angular.module('dmv.shared....
0
votes
1answer
26 views

Angular: using templateUrl breaks compile-link ordering in directives

I've came across with problem exposing api of directives in order to its interaction with controller. There is a simplified jsfiddle to describe my structure. The problem is that directives has ...
0
votes
0answers
21 views

ES6/AngularJs 1.5.5 directive/ngMessages Error: [$compile:ctreq] Controller 'ngMessages', required by directive 'ngMessage', can't be found

I am using angular.js 1.5.5 and ES6 My project uses gulp, webpack (I am mentioning this as I am not sure if this is causing any troubles around some exclusion/inclusion of angular-message.js in the ...
0
votes
0answers
19 views

Angular throwing cryptic error, can't figure out root cause

I'm developing a CRUD SPA with UI Router. Here's the state: .state('admin', { url: '/admin/', templateUrl: 'ui/admin.html' }); The link: <a ui-sref="admin"><span class="...
0
votes
0answers
14 views

Is there a cost associated with switching between isolated scopes?

For example if you have several isolated scope directives within a single page that all listen for the same broadcasted event will there be a performance cost associated with the context switching ...
0
votes
0answers
21 views

angular directive scope got overriden

I am trying to use isolated scope for a directive which is having two way data binding. Please refer my code below: function singleSelectDropdownList(methodCallHelper, $timeout) { var ...
0
votes
0answers
31 views

AngularJS Custom Directive using ng-options populated from service

I've really hit a brick wall with this, and I know I'm probably missing something here, but I'm stuck and need help. What I'm trying to do is use a service to populate the options in an ng-options ...
0
votes
1answer
25 views

Getting the sum of all values in object - ng-repeat

I feel like I am missing something basic here, and would love some help. I have some data that looks like this "playerPoints"{ "ted":{"military":3,"gold":2}, "bill":{"military":2,"gold":4} } ...
0
votes
0answers
9 views

angular directive stop blur and restore conditionally

I would like to create a directive that saves on blur. It should work as attribute on input element. I need to: call webservice on blur pause blur immediately on success proceed with blur, on error ...
-5
votes
1answer
34 views

How to upload image using AngularJS [closed]

I am uploading image my code working fine when I use below HTML <html> <head></head> <body> <form action="http://www.example.com/customers/5832e319f1f1e5cc296e8802" method=...
0
votes
0answers
32 views

Angularjs form validation for existing value does not work

I have problem understanding why my directive, which checks form validation, does not work. My form definition: <body ng-controller="MainCtrl"> <form name="myForm"> <input ...
1
vote
0answers
18 views

Passing All Parent Attrs Through Custom Angular Directive

I have two directives, one is well established/tested (in example dirB) and the other is a styling wrapper (dirA). I need to write a wrapper directive that will pass all it's attributes automatically ...
1
vote
0answers
12 views

AngularJS Compile Breaks Negative Number Input

I am trying to create a directive that will dynamically add attributes to a field. I got it working, but noticed there is an issue when it is used on number input fields. The input doesn't allow ...
0
votes
0answers
18 views

How to maintain the user session without data loss and without refreshing the page in Angular js

I have implemented an application: Technology used: -- Angular, Mvc, WebApi. How I have calculated the session in the application means? When user login into the app, Set the logout time , Before 3 ...
0
votes
0answers
11 views

Whether to pass servicename or add a new State for each for a better design?

I am having a design problem. Trying to put the situation in a very generic way. I have a UI directive which shows list of files, developed using Angular which is using states(ui-router). It has one ...