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

9
votes
1answer
11k views

What is the default for AngularJS directive scope?

What is the default scope value of an AngularJS directive? Of course, it is not isolated scope. It is true or false. I can't find any documentation on what it is.
0
votes
1answer
5 views

AngularJS < binding for components and directives

It seems AngularJS has a new binding symbol: <. The documentation mentions < for Components but isn't really clear about Directives. So two questions: Is < binding applicable for Directives ...
2
votes
2answers
2k views

Custom Pushpin with Angular directive content on a Bing Maps

I'm using the Bing Maps AJAX Control to display a map. And I've created an Angular directive for the Pushpins I'd like to put on the map: app.directive('myPin', function(){ return { ...
1
vote
2answers
18 views

Passing scope parameters to a Custom Directive as ng-src is being called repeatedly

My current implementation is shown below which is working but as the getImage method is inside expressions its being called repeatedly when any text change or data is entered on the page HTML ...
21
votes
4answers
79k views

trigger click event from angularjs directive

How can i trigger a click event for li elements specifying their index from the angularjs directive? I have tried using $first for triggering click for the first element, but its not working. Thanks ...
1
vote
1answer
28 views

How to embed javascript component in Angular 2 app?

In my Angular 2 application, I would like to embed this "tags input component" which is written in plain Javacsript: https://github.com/yairEO/tagify What would be the correct way to include/embed ...
0
votes
0answers
12 views

sx-sref not being compiled to href

I have the following directive that I'm using to generate links (among other things). I've simplified it somewhat here: oActivityModule.directive('activityDetails', function () { ...
0
votes
2answers
42 views

Implement Authorization in AngularJS

I want to implement authorization in AngularJS. In my project which is some kind of social media, different roles or even same roles may see a view file differently. For example imagine we have two ...
0
votes
2answers
23 views

how to remove object from $scope. variable angularjs

How to remove one object from $scope.Profile.address object please help me see below code and image <tr ng-repeat="x in Profile.addresses"> <td><input type="text" class="form-...
19
votes
2answers
5k views

How to add conditional attribute in Angular 2?

How can I conditionally add an element attribute e.g. the checked of a checkbox? Previous versions of Angular had NgAttr and I think NgChecked which all seem to provide the functionality that I'm ...
1
vote
1answer
29 views

Find child elements of transcluded directive but exclude its own nested directive child elements

Say I have the following code: (Plunkr: https://plnkr.co/edit/lhSmKWq3dkDScLQlXMAX) <directive-a id="1"> <a href="">1</a> <a href="">1</a> <directive-b> ...
0
votes
0answers
15 views

Unit testing attribute angular directive with Jasmine 2

I have an attribute directive that will be used with another parent directive: function childDirective(/*injection*/) { return { restrict: 'A', replace: true, transclude: false, ...
0
votes
2answers
33 views

Angularjs directive with dynamic template and transclude

I'm trying add a dynamic template and met problem with transclude. This is dynamic template function: var getTemplate = function(contentType){ var template = '<button style="cursor: pointer;...
0
votes
1answer
18 views

Directive callback executed after ng-if removes directive from scope

I have an angular directive on my page, within ng-if. I have a service which exposes a function that receives a callback as a parameter. Let's call this function functionX. When the ng-if expression ...
0
votes
1answer
16 views

call custom directive inside custom directive template

I am using an angular custom directive called 'teeth' to create multiple canvas elements on the HTML page. I placed another custom directive 'draw' , inside teeth directive, I want to call 'draw' ...
0
votes
2answers
25 views

Angular directive is not compiling after ng-click

The below code is not working after I click on the button. It seems the directive is not compiled again. Can anyone help me out with this ! HTML : <button ng-click="run()">click</button&...
0
votes
1answer
27 views

Change nested views through ng-click in ui.router

I am trying to insert views inside view. But it is working only at the defined state but when I trying to change the view with the help of ngClick the state lost the path. It is like View 1 --...
0
votes
1answer
15 views

[[object HTMLUListElement]] while loading angular treeview in angularjs

I'm trying to use angular-treeview for creating a document tree. But even after doing all the steps as mentioned the result I;m getting is [[object HTMLUListElement]] . Now I'm not sure what should I ...
0
votes
3answers
731 views

Extending a 3rd party angular directive and changing its template

I'm using Daniel Crisps AngularJS Range Slider https://github.com/danielcrisp/angular-rangeslider and would like to extend his directive and modify the template. His directive looks something like ...
2
votes
2answers
28 views

Regex to Allow a Special Character (:) and numbers and alphabets only

I am using AngularJS directive for my form input validation .Is there a way to make my regex allow only one special character(:)along with numbers and alphabets . This is the directive i found on ...
0
votes
0answers
10 views

Upload image shows error “Cross-Origin Request Blocked” [duplicate]

When I use the logic below it causes following error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.example.com/images/...
0
votes
0answers
27 views

How can I hook event handler for table rows dynamically with directive link?

I am writing a typescript directive and trying to hook the "click" event handler dynamically for all html table rows within the "link" property of the directive. I tried and it does not work. When I ...
12
votes
8answers
19k views

prevent multiple form submissions using angular.js - disable form button

I want to prevent multiple form submissions using angular.js. The question is related to this question. When the user clicks on a form submit button the value / label of the submit button should ...
0
votes
0answers
37 views

Angular directive add template on textbox (enter of Spacebar)

I am using angular js,My target is to show a html table on (enter of spacebar) in textbox and add the element of the table in that textbox,for that i have written a directive,but i am not sure whether ...
0
votes
1answer
24 views

how to upload file using Angularjs, multipart/form-data

i want to upload image using Angularjs anyone know how do this..REST API wants Content-Type:multipart/form-data www.abc.com/images/id Request Body { // --Boundary_1_1626119499_1392398808202 ...
2
votes
2answers
10k views

Is there any way concatenate the variable name with a string or it is basic programming Mistake

I am working on an AngularJs app. I have an array of HTML select tags where I am concatenating the ng-model name and the options list name with a variable. He re I have two list or arrays. the first ...
0
votes
1answer
5 views

How can i implement expandAll and Collapse all feature in treetable using angularjs

I have used this link codepen.io/sliiice/pen/GurpF to implement tree table in my application but unable to create a expandAll and collapseAll feature in it. Can anyone help me out in implementing ...
0
votes
1answer
12 views

my directive not able to access controller method in angular js

I really don't know why this should not work... please help spot the reasons. var app = angular.module("schoolBook", []); // Data for friends app.factory("friendsData", function(){ return [ {id:'1'...
1
vote
1answer
23 views

Having Highcharts directive how to get/change current path onClick event?

I have a highchart directive with clickable bars. What I want to achieve is onClick to clean up the query parameters and then add a new parameter from the chart to the URL. However, when I injected ...
1
vote
4answers
50 views

AngularJS - Call specific Directive function/method from Controller

Directive myApp.directive('vlcControls', function ($compile, $rootScope, $timeout, $window, pictureboxConstants) { var linker = function (scope, element, attrs) { vlcPlayerCustomTemplate = ...
3
votes
1answer
51 views

Where do we find the textarea element of TextAngular

In this post about the angular text editor called textAngular. I would like to find the textarea element of the directive text-angular. Because it uses bootstrap design and i would like to replace ...
0
votes
2answers
423 views

[[object HTMLUListElement]] while loading custom UI in angularjs

I was trying to load a tree view inside div element of tabular type in Angular JS, but it is not loading the tree view instead it is showing a message as "[[object HTMLUListElement]]" in the UI with ...
1
vote
3answers
42 views

how to display date only in datepicker from database using angularjs

app.controller('getUser', function ($scope, $http, $cookieStore) { $http.get('http://localhost:8080/myapp/user/'.concat($scope.getUserId) + '?access_token=' + $cookieStore.get("access_token")). ...
28
votes
1answer
11k views

AngularJS Directive element method binding - TypeError: Cannot use 'in' operator to search for 'functionName' in 1

This is the controller of the main template: app.controller('OverviewCtrl', ['$scope', '$location', '$routeParams', 'websiteService', 'helperService', function($scope, $location, $routeParams, ...
1
vote
2answers
110 views

why ng-show not working correctly in angular?

I want to show a drop down when user click on icon .I use ng-show but it is not displaying the drop down menu option. I make a icon ... .on click I try to open drop down menu using ng-show .but it ...
0
votes
1answer
8 views

Angularjs seleccionar continentes y paises en un menu desplegable [on hold]

necesito ayuda, estoy utilizando Angularjs y necesito saber como hago para que mi aplicación web tenga un menú desplegable donde sus items sean todos los continentes del mundo y al lado tenga un menú ...
0
votes
0answers
22 views

two way binding-data angular js ionic from directive to controller

I wrote a directive where i use the plugin swiper js for my slider of images.Now i want to get the reference of the swiper object in my controller because i have to update the slider when i add ...
0
votes
2answers
20 views

Use a directive to display scope value and update scope

I have an array of vertex values that I loop over and display to the user. The values are stored as a space delimited string, like this: vrtx = ["10.3 20.3 10.5", "13.2 29.2 3.0", "16.3 2.3 20.2", ......
0
votes
1answer
28 views

Can't remove Google Map Markers when reloading data

I'm a having some trouble with google maps V3 API. Here's my AngularJS Directive: ; (function () { "use strict"; angular.module('LoVendoApp.directives') .directive('map', ['SimpleRETS', '...
0
votes
0answers
7 views

How to achieve 2-way data binding between directive template and link function

my directive template - <div class="form form-control">       <input type="text" class ="txtBox" name="query" ng-model="criteria" ng-change="Users()" placeholder="To: Name or e-mail"> <...
0
votes
2answers
24 views

How to aggregate ngMessage of several field

I am using Angular JS ngMessage directive for form validation and I would like to aggregate ngMessage alert of several fields. Basically, my form contains 3 inputs (day, month, year) and I want to ...
3
votes
2answers
32 views

Recompile an element in angular, but not rebind angular events

Here's the problem, I need to create a directive that "imports" another directive dinamically. To do so, I add the attribute of this other directive to the element and recompile. I added an exemple ...
0
votes
1answer
33 views

How to add uib-dropdown to a uib-tab to create a simple dropdown menu on a tab made with angular bootstrap?

i'm a novice when it comes to angular js (v1.5) and i'm currently working on a project using angularjs(v1.5), bootstrap 3, UI Bootstrap. i tried to add the dropdown directive to the tabs directive as ...
0
votes
0answers
10 views

Controller 'formioElement', required by directive 'formioElement', can't be found! in angularjs

I am implementing a form using form.io in my angular page. I need to display different forms on click of their name. Html <div ng-repeat="form in TemplateNames"> <a href=...
1
vote
2answers
819 views

Angulrjs : need to help to make c3 direectives to reload data and changing chart types dynamically

I am facing problem with c3 directives to reload data and changing the chart display type. Please see my plunker at http://plnkr.co/edit/wWJx3zU3Sm1cN9ZCtvoh?p=preview. For reloading the data, I am ...
2
votes
3answers
47 views

Image source is not binding with scope variable inside directive

In the below HTML, I want to inject 'src' value from scope variable in controller. HTML : <customdir filterby="name" src="imgName"></customdir> The $scope.imgName variable in ...
2
votes
4answers
841 views

has-any-authorithy directive in jhipster application

I have created a new role ROLE_SUPERUSER in my jhipster application. I want a specific navbar menu to be visible to only admin and my new user. I tried using has-any-authorithy as given in authority....
0
votes
2answers
1k views

Angular Directives in Html helper

How to include Angular directives in Html Helper in ASP.NET MVC C#. I dont know how to include it. What I have done is following : @Html.EditorFor(model => model.Questions.Question , new{ng_model=...
0
votes
2answers
684 views

Converting daterangepicker to angular directive

I am trying to wrap a daterangepicker plugin into an angular directive. Although I managed to make it work by alerting the selected dates in the callback function, I cannot seem to either save the ...
0
votes
3answers
34 views

How to pass object to directive through attribute in AngularJS?

I want to pass object (reference - two way binding) through ATTRIBUTE not by isolated scope. How can I do this? Because code bellow passing string instead of object: HTML <tr ng-form="rowForm" ...