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
1answer
9 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="...
0
votes
0answers
11 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 ...
1
vote
1answer
20 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 ...
1
vote
0answers
13 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
24 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
22 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
20 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
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
20 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
5answers
64 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
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 ...
-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
22 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
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
11 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
0answers
10 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
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
1answer
26 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)...
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
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
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: '&' ...
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("...
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 ...
0
votes
1answer
18 views

Set scopr value by calculated value in HTML

This is sample code of date time picker in Shamsi date tiem The problem is I do not know how set scope variable with gdate the gdateis calculated value in html try with selecting time I want to set ...
1
vote
1answer
30 views

Can I have the angular controller and the directive in separate JS files?

I am using angular 1.5.x . I currently have two files , one has the directive and the other the controller that the directive uses. directive.js (function(){ var myApp = angular.module('...
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-...
0
votes
1answer
18 views

How to use ng-repeat to show a templateUrl

How to use ng-repeat to show a templateUrl? Hi guys i tryied some ways in order to show all elements of a templateUrlby using ng-repeat butunfortunatelly i didn't figure it out!Anyone who can help me ...
0
votes
0answers
9 views

Separate two md-tabs instances

So in short, I have 2 custom md-tabs instances, one has 2 tabs, the other has 4. The one that has 4 tabs is above the one with the 2 in the markup, but when I click the third tab in the upper version ...
0
votes
2answers
39 views

passing scope to directive in angular js

I have the following Angular controller with a simple http get in it: angular.module('SCtrl', ['ng-fusioncharts']).controller('SCtrl', function($scope, $http) { //Get All errors. $http({ ...
0
votes
1answer
31 views

dynamic template adds empty value on ng-repeat

I have been trying to make a query builder for my own purpose. This plunker https://plnkr.co/edit/95VgJfH9nIScwApXyKOu?p=preview has my work so far, When I select a parameter and Click on add, it ...
0
votes
0answers
17 views

Problems with ng-duallist

I'm trying to use ng-duallist from https://github.com/tushariscoolster/ng-duallist but the data is not appearing correctly. I've tried the demo.js which is in GitHub but it's not working for me... ...
0
votes
1answer
25 views

Two nested angular apps and constants

I have a main app: var mainApp = angular.module('mainApp', ['secondApp']) .constant('config', { key: "mainKey" }); And the second app looks like this: var secondApp = angular.module(...
0
votes
0answers
8 views

Angular 1 - How to use a Prototypal Scope and Bind values from Attributes without Watches?

I'm working with angular 1, and I'm currently wondering how to create a child directive that has a prototypal scope, and who contain an isolated value from an ng-repeat directive. The following ...
-1
votes
1answer
30 views

AngularJs directives - Need to get attribute value in templateUrl

I need to get append directive attribute value to templateUrl. I tried several options however, templateUrl does not support $observe in it. Therefore I tried below and tried to get "devicePath" value ...
-2
votes
0answers
16 views

Which event triggered on ng-app? -AngularJs

I have been started learning AngularJs from last few days. As it's stated in angular it's scope starts with ng-app directive. And when I inspect it, It gives a class their on that element class="ng-...
0
votes
1answer
10 views

AngularJS: Component Tree & How to Handle IDs of Newly Created Entities (via HTTP)

I'm using Angular 1. I have a todo list application with a smart (container) component doing server-side interaction, and a dumb/pure/stateless presentation component that displays a list of todos and ...
1
vote
0answers
21 views

Angular JS: One function in the controller is reached , other is not - from view during instantiation of a directive

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

ng-repeat not rendering array changes in the controller

I have a list of items being displayed on a page using ng-repeat. Below is the html. <div class="container-fluid"> <div class="container" > <div class="page-header"> &...
0
votes
0answers
28 views

Show or Hide columns in ngTable based on check box selection

I have a data table with lot of columns and so it is required to scroll which is not very user friendly. I am trying to implement a checkbox where user can select the columns they want to see based on ...
0
votes
0answers
24 views

Angularjs checkbox list validate at least one was selected

I am trying to create a checkbox list that have validation for checking at lest on checkbox was selected. I am using <input type="checkbox" value="{{item.id}}" ...
0
votes
1answer
14 views

Angular UI Typeahead - Trigger typeahead-on-select when ng-model is updated

I have a directive and I am using angular ui typeahead. The myModel has 2 way binding. I will be updating the myModel value in the controller and I want to trigger typeahead-on-select whenever the ...
-1
votes
0answers
6 views

how to show image in pop..page of information already pop page (nested pop)

i have below code i want to show image in pop... but the page of information its already pop page. how to show nested pop... please see code and picture setGetImage(historyimage) { console.log('...
0
votes
0answers
26 views

Detect language of an element angularjs

I use more then one language in my site, and different font-family for each language. I use lang attribute to specify the language, and change the css style. My problem is: I get some of the site's ...
1
vote
1answer
28 views

Angular: Get ng-model by ng-attr-id?

Is there a way to get ng-model value by ng-attr-id ? I'm making a Comment/Reply box and I would like to get the value of the current reply. Here is my html-- <div class="comments-list" ng-show="...
0
votes
0answers
17 views

Getting scope objects from directive link in Angular/Jasmine test

Given the following directive: angular.module('app').directive('dir2', function () { var directive = {}; directive.restrict = 'EA'; directive.scope = { control: '=' }; ...
0
votes
2answers
35 views

ng-view not showing anything in angular

here is my angular app. var MyApp = angular.module('myApp', ['ngRoute']); MyApp.config(function ($routeProvider, $locationProvider) { $routeProvider .when("/RestChecker", { ...
0
votes
0answers
10 views

Share function between controllers with angularjs [duplicate]

I start with angularjs. I would like sharing function between 2 controllers because I want use same datas (json) in differents controllers. I tried to add directive.. app.controller("PostsCtrl", ...