In 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

1
vote
0answers
8 views

jQuery Rateyo rating plugin integration with AngularJS

I am trying to integrate the Rateyo plugin with AngularJS and getting problem in defined rating value from directive, following are codes: Controller var app = angular.module('myApp', []); app....
0
votes
1answer
12 views

Using ng-model-options with ngModelController

I am trying to delay validation of an custom textbox component. I only want to validate the input on blur. The existing component does not use ng-model inside the input but uses the ngModelController ...
2
votes
1answer
22 views

ngModel undefined when using directive - Angularjs controller

My ngModel is undefined when using the ngPattern directive. If I remove ngPattern, the ngModel works as expected. See plnkr. Note how vm.condition does not show when typing a value in the text box, ...
0
votes
2answers
20 views

getting data from angular modal service

First type questioner, long time reader. Newbie to Angular. I am trying to create a popup modal for expanding a text box. (If you have ever dealt with Access, think shift F2). So, I have a form ...
0
votes
0answers
16 views

Trouble with executing Angular directive method on parent

I have a directive inside a directive, and need to call a parent method using the child directive. I'm having a bit of trouble passing the data around, and thought y'all might have an idea. Here's ...
1
vote
2answers
24 views

Angular Directive to component angular 1.5

I have this directive, that i would like to make a component angular.module('app') .directive('year', function () { var controller = ['$scope', function ($scope) { $scope.setYear = ...
0
votes
0answers
14 views

AngularJS 2 Alternate StyleUrsl/TemplateUrl

I have a component where I'm trying to inject a different styleUrl or templateUrl based on an object that is initialized when the component loads. @Component({ moduleId: module.id, selector: 'my-...
0
votes
0answers
17 views

Global Exception handling in angular js using promises : Exception handling: $q promises not catching Error code

I have plan to implemented the Err handling service globally for my existing application. I am not send the error code from server. so i have plan to implement the Error code in angular by using ...
0
votes
1answer
19 views

AngularJS - How to unsynchronize $viewValue and $modelValue in directive

I am using Angular JS 1.5.6 and I would like to programmaticaly unsynchronize $viewValue and $modelValue, I want $viewValue to keep its current value but $modelValue to be set to undefined. I tried ...
0
votes
0answers
14 views

Concatenating directive attribute to template?

Is there a possible way to use the value of an attribute and use it to concatenate in the directive template <text-input txt-info="textName" ng-model="pi.medRecNumber"> </text-input> ...
0
votes
0answers
12 views

angularjs datatable is not working while using datatable='ng' searching and pagination

My Controller .controller('BankaccountViewController', function($scope, $uibModal, $log, $location, $routeParams, $timeout, DTOptionsBuilder, BankaccountService) { $scope.dtOptions = ...
0
votes
0answers
24 views

sorting a json array programatically

This is th json, this need to be filtered based on the "testType" equal to 'R' also had to sort based on "createdDate" { "code": null, "message": "Total 1 records found", "result": { "size"...
0
votes
1answer
19 views

How to redisplay directive after Javascript function executes

I have an AngularJS Directive defined in a Javascript file that looks like this: (function () { 'use strict'; angular .module('ooApp.controllers') .directive('fileUploader', fileUploader); ...
2
votes
1answer
19 views

Pass rendered string into Angular directive

I am trying to make an angular directive that renders dynamic content urls based on an attribute placed on the directive. Example: Directive: angular .module('myModule') .directive('...
1
vote
0answers
20 views

how to open API services call to a new window?

I try to open the API service call to a new window tab but tried to use window.open() and it doesn't work. I also tried to put the ng-href="URLwithParam" in the HTMLtemplate with target="_blank". I'm ...
0
votes
1answer
32 views

Call link function directive Angular 1 ES6

I create a directive based on ES6 style: export default class myDirective { constructor() { this.restrict = 'E'; this.scope = {}; this.link = link; } link() { ...
2
votes
1answer
26 views

navigation does not work with ng-if condtion

hi i need help from you guys, when i add in ul with ng-if condition navigation does not work, how to solve this please help <nav id="menu" class="nav-main" role="navigation"> &...
0
votes
1answer
42 views

Controller and directive variable's scopes

I'm new to AngularJS. I've started learning it from basics and began doing the simplest examples and the custom ones. Recently I've found some strange behavior of AngularJS. I have the following code ...
0
votes
0answers
20 views

AngularJS - Custom validation directive crashes input[number]

In my case, when i move angularjs the slider, new value (value1) is calculated according to the slider value and new value is written down. But new value should not be greater than value2. My custom ...
2
votes
0answers
28 views

How to use $compile inside an AngularJS link function with a $watch

Using AngularJS and Angular-UI Tooltip (uib-tooltip) to setup a tooltip system that allows the user to turn the tooltips on & off. I'd also like to keep the text in a central location for easy ...
1
vote
1answer
22 views

angularjs form validation showing success on page load

I have a function in my controller to validate if maximum of three choices are made out of available checkboxes and one free text area. The user can either choose three checkboxes and leave the text ...
0
votes
0answers
15 views

angular material not working / css is not applying

Here is my index.html look like. I put all angular material js and CSS in my css,node_modules folder. <html> <head> <link href="img/favicon.png" rel="icon" type="image/x-icon" /&...
0
votes
1answer
25 views

Angular recursive template

I have a directive with an item template that recursively references itself but is not properly rendering out children beyond the first level. I've looked at several examples and it seems my example ...
1
vote
1answer
22 views

Angular directives collision

I would like to use 2 directives in the same app. The problem is that when I use the second one, the first one crashes with an ugly error: TypeError: Failed to execute 'getComputedStyle' on 'Window': ...
0
votes
0answers
20 views

How to pass value from custom directive to html page which is in templateUrl

I have written a standard code to write the custom directive which displays the page defined in the templateUrl, and its working good with the code shown as below. Now I want to pass variable with ...
0
votes
0answers
24 views

Working with null/undefined dates in an Angular multi-input date directive

I'm setting up an Angular (1.5) multi-input date input directive. It works fine for updating an existing date, but when the model it's trying to update isn't defined yet, or is null, I'm not able to ...
0
votes
1answer
33 views

What happened to the directives property in the Component decorator for Angular 2?

I am using the Angular CLI v1.0.0-beta.19-3 to scaffold/build an Angular 2 website. I generate my component as follows ng g component file-upload. I noticed that the generated component file-upload....
0
votes
1answer
21 views

Watch directive scope not working

Context My controller stores an array. When pressing a specific shortcut on the keyboard I add a new object to this array. The array is used inside a directive to display a chart. So, on shortcut ...
1
vote
1answer
8 views

wrap md-list-item in custom directive

why i can't wrap an md-list-item in a custom directive ? Original html <md-list class="md-dense"> <md-list-item ng-repeat="user in items"> <img ng-src="{{user....
1
vote
1answer
21 views

Optimizing code in angular directive

In angular directive init function i am declaring constant and utilizing the constant in html. I have multiple directives utilizing the same constant i want to keep the constants a reusable one. In ...
0
votes
0answers
25 views

Kendo treeList using angular directive creating a memory leak

I am using mutliple Kendo treelists in my app so I have a directive to create them, they all run fine except for one that holds a lot of data.Each node in the tree has an ng-model and ng-click on it ...
0
votes
0answers
16 views

How can I make an AngularJs directive work at a specific screen size

I have this directive that adds and removes a class to a header section when I scroll the page, a hide/show header. I would like to have this directive work only on a screen size less than 600px. Any ...
0
votes
1answer
12 views

angularjs directive currency formatting according to chosen translate language

I am formatting the a number in the format of currency, with decimals and comma/point to mark the thousands. app.directive('format', ['$filter', function ($filter) { return { require: '?...
0
votes
1answer
14 views

Change element height on animation start (Angular)

I've set up a transition that slides between my views, like so: https://plnkr.co/edit/yhhdYuAl9Kpcqw5tDx55?p=preview I need to set the view position to absolute in order to make the two 'panels' ...
1
vote
1answer
24 views

Module 'ng' has no exported member 'IDirective'

I am implemeting Angular 1 directive with TypeScript. Everything looks fine, it compiles, but I receive the following error in my Visual Studio Code editor: Module 'ng' has no exported member '...
1
vote
1answer
20 views

Error during Karma Test execution

I have a problem current where my directives were build as following : selectprice.directive.js file (function() { 'use strict'; angular .module('app.buyouts.selectPrice') .directive('...
3
votes
0answers
33 views

Dynamically added attributes don't initialise

I am trying to dynamically add attributes to html elements that are generated and compiled in an ng-repeat statement. I am using the following directive on input elements. .directive('ngLoading', ...
0
votes
0answers
13 views

ui-typeahead - Working with object levels [Resolved]

I have a person object: person = {}; person.city = {}; person.city.state = {}; First select the State <input type="text" class="form-control" ng-model="person.city.state" uib-typeahead="state ...
0
votes
1answer
40 views

Change template in angular directive dynamically

I have a controller, that has some variables: .controller('DataProvider', function($scope, $timeout, $mdSidenav, $mdDialog, $mdMedia, $mdToast, selectedData) { $scope.provider; $scope....
0
votes
1answer
35 views

AngularJS update value in a directive

I have a problem when trying to change the value of a variable from a directive. I did a plunker so it is more understandable because I cannot explain it correctly. I have two buttons list : One is ...
0
votes
0answers
20 views

kendo autocomplete and keypress events

I implement an Angular directive based on the Kendo Autocomplete widget. My implementation includes handling the autocomplete events. On each onkeypress event my directive must perform asynchronous ...
0
votes
0answers
10 views

adding a movieClip with angularjs directive

I am trying to create a angularjs directive in order to add a movieClip to scope.stage But it has nothing in canvas(on browser) meanwhile I check scope.stage.numChildren is 1 and don't have error is ...
2
votes
1answer
77 views

Angular2 dynamic component

i work with angula2 + typescript. Right now in progress to add angular2-busy. For this library i need include angular2-dynamic-component, but i don't know what i must do with him This is error This ...
0
votes
1answer
24 views

Angular ng-messages inside custom directive inside ng-repeat wrong behaviour

I have same problem as described in this toppic: Angular JS ng-message inside directive Unfortunatelly that solutions is not working for me, because I am using my custom directive inside ng-repeat. ...
0
votes
0answers
15 views

Directive link function passed element is the whole page

The element passed variable in the link function of a directive contains the whole HTML of the page instead of just the directive HTML angular.module('app.elements').directive('inputWithTags', ...
0
votes
0answers
55 views

Tr td ng-repeat angular

Using angularjs1.x My json is [{ "headerid" : 1, "datatype" : "label", "fieldname" : "food", "maxval" : 10, "minval" : 20, "parentid" : 0 }, { "headerid" : 2, "...
0
votes
2answers
16 views

Custom Directives and Template doesn't work

I'm trying to make a custom directive that will show some elements that i previously declared in the MainController HTML body: <body ng-app="myApp" ng-controller="MainController"> <h1> ...
2
votes
1answer
25 views

Custom compile function removes two way binding

I have an attribute directive my-directive in my Angular 1.5.8 app. I want to add it to an element and also I'd like to pass two extra parameters, one with one-way binding (@), the other with two-way ...
0
votes
3answers
47 views

Using Angular ng-src with absolute urls not showing

I have an image with an absolute url like "https://someimageurl.com/image.png" that is hosted via a third-party service. // in controller $scope.image = 'https://someimageurl.com/image.png' I'm ...
1
vote
3answers
39 views

Possible Angular attribute directive bug?

I'm trying to create an Angular directive which is just an HTML attribute (my-directive). This directive uses some input attributes (text, length). <li my-directive text="first" length="6"></...