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
13 views

Angular - ng-click function on transcluded directive content is not triggered

I have two directives, parent directive should simply wrap around its child. The transclusion is used for this purpose. However, then any other directive, such as ng-click, bound to the child ...
0
votes
0answers
18 views

Input type file not functioning when used as a directive in a dynamically created directive

I am rendering a directive (x) dynamically using the $compile service. This directive consists of another directive (y) which is a form to upload image consisting of the input type file. This input ...
0
votes
1answer
17 views

Getting Uncaught Error: [$injector:modulerr]

I'm new to angular, and in the middle of refactoring my app to match John Papa's style of angular 1. However, this seem to break my views. I get Uncaught Error: [$injector:modulerr]. I'm referencing ...
1
vote
1answer
14 views

How to use Angular directive inside Kendo Grid Column

This is relatively simple, or so I would have thought. I have a custom Angular directive - I can add it to the DOM with <custom-directive ng-model="someAngularScopeObject"></custom-...
0
votes
1answer
27 views

Show form in each block was created by ng-repeat?

I have the following HTML code: <div class="row"> <div class="col-md" ng-repeat="song in songs"> <div class="title"><div class="add">+</div></div> ...
0
votes
0answers
7 views

Angular Material to replicate Google contacts on hover change icon to checkmark

In an attempt to replicate what is done recently in google contacts I tried the following: http://codepen.io/anon/pen/wgpyQY?editors=1010 <div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp"&...
0
votes
1answer
16 views

Using element.bind in validation directive

I trying to validate input with custom directive: .directive('customValidation', function () { return { require: 'ngModel', link: function (scope, element, attr, ...
-1
votes
1answer
29 views

How to trigger the function after DOM markup is loaded in angular style application except onload

I need to show a Simple current time with an angular based-application.So have tried a demo. In the body onload function execute the piece of function. <body onload="startTime()"> function ...
0
votes
2answers
32 views

AngularJs directive function doesn't work when declaring scope

I have a directive in which I'm passing an array of data via scope. However, when I click on a button with ng-click, the function doesn't work. This is my directive: angular.module('appModule')....
0
votes
1answer
24 views

ENTER keydown doesn't work in IE! Angular

I have an input field where users insert a video url, and when press 'enter', video player display that video. It works fine in Chrome, Firefox, Edge but doesn't work in IE 11. It starts working only ...
0
votes
4answers
34 views

ng-change does not work, directive cant be found

<select id = "email_templates" name = "email_templates" class="chosen-select input-md form-control" ng-change = "alert('template selected');"> <option value="0">No template selected</...
0
votes
0answers
20 views

Passing a validation attribute to custom directive conditionally

I have a custom directive that I am using for text input so that I can use it for various input fields, similar to below (actually using ng-messages in actual code). app.directive('...
0
votes
0answers
23 views

Angular JS : Uncaught DOMException: Failed to execute 'removeChild' on 'Node' on HTMLScriptElement.callback

I am using Angular JSON Http call. in the same When I make the post request like this : app.service('AjaxService', [ '$http','$q','$sce', function($http,$q,$sce) { return { ...
-1
votes
1answer
19 views

i am new to writing angularjs directives how to add style to directive template

I was using the <style> tag in the template. Is this the best way or are there any other better ways the css code is around 20 lines.
0
votes
2answers
29 views

ng-model not working propertly with ng-options and array

After changing from ng-repeat in select options to ng-options i came across some problems. The issue is that ng-model sends whole array instead of the selected one. I have an array with few values ...
0
votes
0answers
15 views

Directive/Component name 'ng ' is invalid. The name should not contain leading or trailing whitespaces

Trying to run my app in production And get a strange error CODE/ERROR MESSAGE angular.js:68Uncaught Error: [$injector:modulerr] Failed to instantiate module ng due to: Error: [$compile:baddir] ...
0
votes
0answers
21 views

$compile: ctreq error not been thrown after upgrade to angular 1.61

I had just started the migration from angular 1.48 -> 1.61 I had left with a unit test which refuses to pass. We want to verify that the directive we wrote, will not change in the future such that it ...
0
votes
0answers
18 views

how to create guest user to angular rails app without populate database?

I have angular - rails web application. My web app is already in production mode.i'm using devise gem. I want to create a demo for Guest Users to login as admin or regular users to try it. How i make ...
-1
votes
0answers
14 views

Image gets corrupted after uploading in angularjs

I am using simple file model directive to upload a pdf file in angular js. For uploading file.. i am using a reference from tutorialspoint website. I am calling a wcf service to save the file on ...
0
votes
1answer
31 views

Angular directive controller scope

I'm trying to develop a directive that has it's own controller so it can collect the data it need's from the API and be injected anywhere. Here's what I got so far: (function () { 'use strict'; ...
2
votes
1answer
35 views

AngularJS Directive callback function timing issue

I've stumbled upon an Angular issue that I just don't understand or know how to solve the problem. I'd like to have a callback function located in a controller that a directive calls once something ...
2
votes
2answers
30 views

How to display a textbox in place of text in a column in a table on button-click in angularjs

I am trying to create a small angular and php app. I want to display table and be able to edit it by displaying textbox in place of the old text on the click of a button. Can you please help me with ...
0
votes
1answer
36 views

Does Bootstrap create gutters inside custom directive elements?

Using Bootstrap and Angular. I have a div inside a custom directive. Even when I set the child div width: 100%; it seems there are gutters on either side of the child div. I tried to adjust margin and ...
0
votes
0answers
20 views

Modify tabindex inside ng-bind-html

I am adding some text using the ng-bind-html directive. Sometimes, it contains some links with the classic tag. I'd like to set tabindex to -1 but it's not working. Is there a nicer way than brute ...
0
votes
2answers
22 views

How to update directive when a scope variable changes?

I have created a directive that highlights text in a div if it contains a one of the specific keywords: Like below angular.module('app', []).directive('words', function() { return { ...
0
votes
0answers
15 views

Angular 2 Directive setElementStyle not working with Firefox

I have some problems with my Angular 2 directive on firefox. I change the background color of my navbar when user scroll the page down. @Input() pointToChange : number = 200; constructor(private el: ...
1
vote
3answers
32 views

Angularjs How to highlight text in div if it equals to some keywords

I have a div with an attribute words that contains some keywords separated by a blankspace. <div words="automobile physiology crime"> The dentist travels every coverage. The talent pumps ...
0
votes
1answer
19 views

Angular 2 error directives

I could use some help over this, I'm learning about ANGULAR 2 routing, I'm getting this error: app/app.component.ts(7,12): error TS2345: Argument of type '{ selector: string; templateUrl: string;...
2
votes
2answers
45 views

“$parent” in multi-level directives

I am trying to understand a working code. It can build a very simple json data by adding name:value pairs one by one with GUI; by a custom directive and its link function, it builds a html template as ...
2
votes
1answer
41 views

AngularJS Evaluate a Attribute directive after a Element directive

I'm using the following angular plugin https://github.com/angular-slider/angularjs-slider My goal is modify the "legends" generated by the directive. For this, the directive receives an Array on the ...
0
votes
1answer
33 views

Directive not working with ng-if

I have the following directive that works correctly unless i use a ng-if on the containing element as well. What I am trying to do is simply set a dynamic property on the scope with an associated ...
1
vote
0answers
29 views

Can a directive inherit a ng-click from his parent scope?

I am trying to work with ng-view directive and I want to batter understand the parameters of my scope and controller. my web page has a static part and inside of it the ng-view directive like so: &...
-2
votes
0answers
29 views

Angular JS : Is it ok to have 92 watchers on a page? [closed]

I am making an application and I have 92 watchers on page. I came to know this through a plugin named : $$Watcher I have read in a blog that it is ok to have up to 2000 watchers on the page, Do I ...
1
vote
0answers
36 views

Angular service to share data - Is this the correct approach?

Hello Angular Gurus, I'm using a service to share data between two controllers. I'm sharing data between BankController and CreateBankController. What I observe is that the CreateBankController ...
0
votes
1answer
31 views

using Angular Strap, not able to popover the selection menu?

//test.js $scope.popover = { "title": "Title", "content": "<select ><option value = "volvo"> Volvo </option> <option value = "saab"> Saab </option> <option ...
0
votes
1answer
53 views

Using jQuery plugin as Angular Directive

I'm trying to use a jQuery plugin that can curve text (Arctext.js) as an Angular Directive. The Directive seems to work fine, the given text is curved as expected, except that I want this text to be ...
0
votes
0answers
11 views

Consicutive nvd3 directives causing no graph

I have an application where I need to show the Multichart and lineChart in single html page. HTML: <div class=""> <div ng-show="line_graph_type_header == 'PVVoltage'" ...
1
vote
2answers
36 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
22 views

How to find the way to use SheetJS in AngularJS 1 dependency injection is not acceptable and error occurs

I cannot find anyone install the SheetJS to their AngularJS app with dependency injection. I just found the guy without dependency injection and as a plunker here. But how to import library into ...
1
vote
0answers
44 views

Angular dynamic directive attribute not evaluating when used with ng-repeat

I'm trying to pass in a string that comes from a list in my controller which contains the template name that should go get the template dynamically (i.e. template="{{item.template}}") I've attempted ...
4
votes
1answer
73 views

AngularJS - Filter already selected items from ng-select inside ng-repeat

I've found similar questions but no one is having the same problem I'm having. I have a list of localizations that a user can add to (for building their own localization of our UI). They can have ...
0
votes
0answers
23 views

Angular2 upgradeComponent how to do 2-way binding

I have a large application that I am just beginning to upgrade to Angular 2. We use a lot of third party and homegrown custom directives that we will replace in Angular 2, but do not have the time to ...
0
votes
2answers
34 views

Add class to next element in Angular2 Directive

I have a dropdown menu and I wanna use angular2 directive to handling open/close of this dropdown. How can I add open class to the latest-notification div . by knowing that my directive applied to the ...
0
votes
3answers
47 views

Angular restrict input only to number on pasting

I have this directive that runs in <input type='text'> to restrict the user input to type only numbers. Works fine! My problem is that if the user copy/paste some string, angular is accepting ...
0
votes
1answer
20 views

Angular directives are being call before data/token throws error

I have a service that will auth my user and get a token. I'm consuming it on the mainController which is appended to the body (index.html) That should be the frist thing to do in my app. In my index....
0
votes
3answers
28 views

How to set watcher for input.$error object with directive in AngularJS

I have a form that contain date inputs and select elements, I tried to use ngChange but I found it not very useful when handling dates errors. So I'm trying to set a watcher in a directive for every ...
0
votes
4answers
53 views

AngularJs Custom Directive scope data overwritten

I have displayed the products based on branch and billing account. In the product template, i have a "+" button, if we click on the button, then i'm displaying the particular product id below that ...
1
vote
1answer
36 views

Angularjs: Compile ng-repeat dynamically

I have found some strange behavior with Angularjs. My directive simply adds and compiles ng-repeat to my dom element. However the scope variable item is not accessible. Look at the code below for ...
1
vote
0answers
22 views

Angular NG6 IE assignment to read only properties is not allowed in strict mode

View IE console Error keep getting this error in IE and Mac safari and iOS devices. in pageheader it only display {{$ctrl.title}} not the value, any idea about this? Games.js import angular from '...
0
votes
0answers
35 views

element.remove doesn't execute after success $http call

I'm using a directive to check if the user has the right role to view a certain element. This is my directive : angular.module("BlurAdmin") .directive('restrict',restrict); function restrict (...