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

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
15 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 ...
-1
votes
0answers
12 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
28 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
29 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
28 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 ...
-1
votes
1answer
40 views

Angular2 Error: (SystemJS) Unexpected token }

I am trying to set up angular 2 Web application without npm when I run and a browser tab opens, I get the "Loading..." with the following error in the console: Error: (SystemJS) Unexpected ...
0
votes
1answer
32 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
19 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
18 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
40 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? [on hold]

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
49 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
10 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
40 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
70 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
21 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
32 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
41 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
48 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
35 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
34 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 (...
0
votes
1answer
20 views

Angular 1.5 directive with one-way binding updates parent scope

I have a directive with an isolated-scope and one-way binding variable. yet when i change that variable in the directive controller it updates the parent scope as well. Example code: function ...
0
votes
1answer
43 views

angular 2, *ngFor checkbox check only one

I’m trying to create a dynamic list with checkbox using *ngFor. Here, i want that the checkbox can be checked only one at a time (if user clicks the 2nd checkbox previously selected one should go ...
0
votes
0answers
19 views

How to export a custom directive having HTML files

I am working on angular 1.4.7 and I need to export my existing directive (which has some *.js, *.css and *.html files) as a reusable directive. I am planning to publish it to local npm server so that ...
0
votes
1answer
20 views

angularjs ui grid columns and menu options issue

I am using angularjs ui grid in my application with menu options. The Total column is not appearing in the grid and also in the menu options under columns none of the grid columns are visible. Can any ...
-4
votes
0answers
20 views

Codeacademy Lesson in AngularJS1.x [closed]

I want to include a link to a JS file in an HTML file by using the <script src="..."></script> tags. Here is the specific line I wrote: <script src="js/directives/appInfo.js" >&...
0
votes
0answers
14 views

ui-select directive wrapper on-select not updating

So I've been struggling here with trying to make the on-select event update my parent variable. I have a controller with html template: on that HTML template I call my directive which is a wrapper ...
0
votes
0answers
24 views

Issue with AngularJS custom input type=“email” directive

I'm using a custom input directive to control all types of input (text, email, password, ...). Basically, my custom input directive looks like this: ui-textfield.js angular.module('app').directive('...
0
votes
1answer
12 views

unit testing directive with link using controller

I'm trying to unit test my directive that set form validity depending on a controller variable. My directive code : angular.module('myModule',[]) .directive('myDirective', function() { ...
0
votes
2answers
24 views

Angularjs Directive : html passed as String to directive does not render in template

I have created an angularjs directive called image-multiselect which can be used as follows. <image-multiselect items="landTransportTypes" image="illustrationURL" itemname="name" append="<...
0
votes
1answer
39 views

Not allow two or more zero's regex at the start for custom angular directive

I'm writing an angular directive which only allows user to enter numbers in input field within range. html code <input non-negative-number range-min="1" range-max="5000" ng-model="number1"> ...
0
votes
1answer
21 views

How do you set a breadcrumb active or highlight it when it is clicked?

The Header displays the letters from A to Z. Below is my html code: <div class="col-sm-9"> <ol class="breadcrumb"> <li *ngFor="let letter of letters"><a (click)="...
0
votes
3answers
23 views

AngularJS: Directive not working properly

I find myself writing the same "search" UI on every module. So I've decided to write a directive, which I understand injects code as a module so that I can re-use it everywhere. Note: Without this ...
0
votes
0answers
27 views

AngularJS + update graph in amCharts

I'm having difficulty with angularJS to update the graph correctly after a query returns on a service. Basically after the query return, I need to display the chart according to the return, but the ...
0
votes
3answers
35 views

Angular: unable to share object between two sibling directives

In my app, under a certain view I create two directives, dir1 to loop through an array of objects, and dir2 to show extra info, upon clicking\selecting something from dir1, so this basically means ...
0
votes
0answers
22 views

Angularjs directive callback function not working with grid

I am trying to configure my app which works on keyboard shortcuts. I have even succeed on this with button but when I try to configure the same thing inside my grid view as template it doesn't work. ...