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

AngularJS: Directive not working properly

I am writing an angularJS app, and find myself writing the same "search" UI on every module. So I've decided to create my first directive, which I understand injects code as a module so that I can re-...
0
votes
0answers
32 views

Developing an AngularJS Directive for table's select all or select single

Our team using Angularjs to developing the SPA. There is a table in the page.And the first column, it had Select All, each row had "Select", if we using the normal logic codes for this feature, it is ...
0
votes
1answer
27 views

Angular 1.5 Component Two Way Binding Not Working same using $ctrl

I have some products that I need show personalize with a component in my index.html. In the end I need totalize a grand Total of selected products in $scope main controller "planosVoz". But my two-way ...
0
votes
1answer
19 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
28 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
1answer
22 views

Angular directive: whats the difference between scope in controller vs scope in link function?

Im learning about Angular directives and I can't wrap my head around the scope topic. Suppose I have this custom directive which is named parentDirective. It has a controller property and a link ...
0
votes
0answers
20 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. ...
0
votes
3answers
24 views

Angular JS : Error while getting data from typeahead

I am getting error while loading the module for angular JS in my Module, UI bootstrap here is not getting loaded despite of all the dependencies resolved. can any one help me ? Fiddle Link https:/...
49
votes
14answers
53k views

How to autocapitalize the first character in an input field in AngularJS?

How to autocapitalize the first character in an input field inside an AngularJS form element? I saw the jQuery solution already, but believe this has to be done differently in AngularJS by using a ...
0
votes
1answer
13 views

Angular 1.4.7 directive bound to all number inputs

I'm trying to figure out if there is a way to bind a directive to all <input type="number"> elements without having to go back and add a class, additional attribute, etc. to each number field? ...
6
votes
3answers
27k views

ng-selected not working in select element

I have a bound select <select ng-model="collegeSelection" ng-options="c as c.CollegeName for c in colleges" ng-selected="c.CollegeName == collegeSelection.CollegeName" name="selectCollege" id="...
1
vote
1answer
5 views

How to use FlickityService to control the start / stop of player

I am developing a photo slideshow using the Angular Flickity directive. I can use FlickityService to call next and previous function to move the slide to the next and previous slide. But how can I ...
1
vote
4answers
2k views

$rootScope.$broadcast not working

I am trying to get $rootScope.$broadcast to refresh my view. The service is- var app = angular.module("productsApp", []) .service("serviceProvider", function ($http) { this.getDatas = ...
1
vote
1answer
23 views

AngularJs : one of four params,passed to directive is undefined

I have a modal view(.jsp) that has integrated directive (named as 'querybuilder', Yellow part in the picture - a js file). Controller(named as 'addEditRuleSetCtrl') and directive is included from ...
0
votes
1answer
15 views

How to include input fields from custom directives in angular forms?

I need to create a simple form with validations like this - https://jsfiddle.net/rohansh20/k7omkz7p/2/ <div ng-app="module1" ng-controller="ctrl1 as vm"> <form novalidate name="vm.form1" ...
2
votes
1answer
117 views
+50

Passing a binding to transcluded scope in component

In Angular 1.5, I want to pass a binding from a component into the (multi-slot) transcluded scope - for a reference in the template (in either one specific or all of them - no either way is fine). ...
0
votes
3answers
20 views

Add call error message from controller in angular material?

I want to add error message, something like this: <md-input-container> <label>Last Name</label> <input name="lastName" ng-model="lastName" required> <div ng-...
1
vote
3answers
31 views

template of custom angular directive repeats every time a scope variable of directive is changed

I have an array binded to an attribute of a custom directive. This attribute value is used in my template part. The template run everytime the array gets changed right?. This template creates a div ...
0
votes
0answers
16 views

md-select rtl with special character issue

I have a list with one of value starting with special character '@'. $scope.neighborhoods = ['john','adam', '@jhonny']; This list is used in md-select with direction: rtl. but in display the special ...
0
votes
1answer
16 views

Angular JS : ng-style is not working while passing data to directive

I am using ng-style for populating width of an element. Code: <div ng-style="{'width':'{{cols}}'+'px'}" id="autocompleteSuggestions" class="autocompleteSuggestionsDropdown" ng-show="...
1
vote
0answers
18 views

How to use angular-filemanager addon in Ember

I installed angular-filemanager with bower install angular-filemanager --save and imported the necessary dependencies in ember-cli-build.js. app.import('bower_components/angular/angular.js'); app....
1
vote
1answer
30 views

AngularJs link function and Jquery manipulation. Code doesn't seem to work

I have a login modal in a directive which I am trying to make it work using link function and jquery but it doesn't seem to work. This is the login button <button login-modal type="button" class="...
0
votes
3answers
28 views

Access the main controller's scope from inside a directive

Suppose the following blueprint code: <div ng-controller="myCtrl"> <div ng-repeat="..."> <div ng-repeat="..."> <div ng-repeat="..."> &...
0
votes
1answer
23 views

Ember How to Run Angular Directive and How to Import Angular

I am trying to use the angular-filemanager addon on Ember and have not been successful at all. I found this other question on stackoverflow which says how to run an angular directive inside Ember, but ...
0
votes
1answer
24 views

how to use google map in angularjs with script of key Without Google SDK

i don't want Google SDK, i have following code..i but its show error when i use tag its working fine but i am using angularjs its show error , normal page with script in page its working fine..how ...
0
votes
5answers
66 views

How to make angular select to select a selected value

I have selected value coming from back end in JSON and i have select element content coming from back end in the same JSON also. Problem is that selected value is not selected in the select element, ...
0
votes
0answers
31 views

Angular directive calling another directive not working

In this plunk I have directive dir1 calling a method in directive dir2 as described here. The problem is that the control object (scope.dir2Ctl) is empty in dir1 and I get TypeError: scope.dir2Ctl....
0
votes
0answers
24 views

Calling link function as to reset message

Here is a part of my code: <div class="col-xs-5 col-lg-5"> <select ng-model="criterion_id" ng-options="..." > </select> </div> <div ng-if="criterion_id===1"&...
0
votes
1answer
24 views

(AngularJS) ng:areq Bad Argument: Argument 'fn' is not a function, got Object?

I'm learning angular. For the last hours my page isn't showing anythin even though the request seems to be successful. The component in question: // Register `eventsQc` component, along with its ...
24
votes
11answers
25k views

Multiple directives asking for templates on

I have the following HTML: <div style="border:1px solid; height:300px; width:500px; position:relative; left:100px" id="canvas"> <tbox ng-repeat="tb in textBoxes" ng-model="tb"> </...
-1
votes
2answers
35 views

Hello World AngularJS directive broken

This code is just supposed to print "Hello world" using an AngularJS directive, but instead of that, the page is blank when I load it in my browser. Here is the HTML: <!DOCTYPE html> <html&...
0
votes
1answer
19 views

How to toggle data in one directive using an ngClick function in another?

I'm building a weather app using Angular 1.5.8 and need to give users the ability to toggle back and forth between imperial and metric measurements for the temperature and wind speed. The toggle ...
0
votes
0answers
12 views

Nested directives with transclusion gets instantiated multiple times. Why?

I have following example code which contains three nested directives each depicted as boxes. Each directive has a controller, a pre link function and post link function. As per the angular docs I was ...
0
votes
0answers
14 views

Angular: Passed params in nested directive is of state “undefined”

We are following an example from http://mfauveau.github.io/angular-query-builder/ and modifying it to fit into our requirement. We have a modal view(.jsp) that has integrated directive (named as '...
0
votes
2answers
27 views

Currency Conversion - AngularJS

I have a question about what the best way is to convert currency at a page. At the moment I have a lot of input fields with a certain currency. When the user clicks on the currency conversion button ...
0
votes
0answers
11 views

how to add google api script angularjs page

How to add this script in angularjs please help me.. when i click from page ng-click="ListCtrl.Location(engineer)" below method call and show other page Location(engineer) i have below HTML page ...
0
votes
1answer
27 views

AngularJS: Passing into a directive link function an attribute AND the entire scope

I have a directive that has an attirbute, it looks like this: <directive config="myConfig"></directive> This is my directives code: app.directive("directive", ["$compile", ($compile)...
1
vote
2answers
888 views

AngularJS: set same height for divs in ng-repeat

I'm an AngularJS newbie developing an app in phonegap using Angular + Angular Mobile UI. I have a list of divs in my template file inside Bootstrap columns WITHOUT USING jQuery. I need to square divs ...
41
votes
3answers
91k views

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document....
3
votes
2answers
9k views

Change the ngModel value from a directive [duplicate]

I am using AngularJS and I created a directive that requires 'ngModel': 'use strict'; angular.module('spot.im.embed').directive('sayBox', ['$sce', '$timeout', '$parse', function($sce, $timeout, $...
0
votes
2answers
20 views

Load different directive depend on screen size at AngularJS?

I have 1 different component layout loaded by directive at bigger and smaller screen. Is it possible to do that at AngularJS? Have read the doc from here and here but no luck
1
vote
2answers
394 views

kendo grid virtual scrolling last row is missing

I am working on a kendo web aaplication. I have a kendo grid and virtual scrolling is enabled.Last row is missing while scrolling the grid but i can see that record by filtering.In IE it is working ...
0
votes
0answers
34 views

AngularJS: How to add setter on $scope object property of directive?

This is my current implmentation to fire callback on customVar get change using $watch... module.directive('mudirective', function() { return { scope: { callback: '&' ...
0
votes
0answers
10 views

Using custom angular directive into kendo ui grid as column template

I have created a custom angular directive, number control, and would like to use that in kendo ui grid column template. How to achieve this? Could someone provide an example? Thanks!
0
votes
1answer
30 views

Access controllers of multiple identical directives sharing the same parent scope

I am having trouble with an angular directive used an an attribute on a component. Basically, I want buttons to be draggable. I do it this way: <body> <xx-button xx-draggable> <xx-...
1
vote
1answer
33 views

Binding Directives after Dynamically Creating an Element in AngularJS

I have a code that dynamically create elements (the x and the parentDiv). var x = document.createElement('myTag'); parentDiv.appendChild(x); And I have a directive that looks like this: .directive("...
1
vote
1answer
25 views

Abstracting out two lines of code in Coffeescript

I am currently working on refactoring two methods that exist in directives into a service. This is method one: scope.computeStyle = (component) -> elementHash = {} if component.element.type =...
0
votes
0answers
6 views

Custom character separator with ngModel is not working properly

I want to format the entered number inside a textbox with a character separator in AngularJs. I have created a directive to do the formatting. The directive is generating proper output but cannot ...
0
votes
1answer
25 views

Accessing controller from compile function in directives

I have searched all over and the only thing I can come up with is that I don't understand something fundamental about how the compile function works. Here is what I have angular.module("app", []) ....
0
votes
1answer
10 views

AnguarJs: ng-repeat only work after clicked button inside directive

I want to bind an array (customLayers) and use it for ng-repeat. I fill the array inside the kv.colorMap Object. I have three directives using these technique. But the directive updates the binded ...