Tagged Questions
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.
0
votes
0answers
19 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
12 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
16 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
18 views
Codeacademy Lesson in AngularJS1.x [on hold]
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
12 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
16 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
10 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
23 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
37 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
19 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
25 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
31 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
21 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
1answer
25 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
3answers
25 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:/...
1
vote
1answer
7 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 ...
0
votes
1answer
28 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
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-...
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" ...
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
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
17 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 ...
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 ...
1
vote
0answers
20 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
31 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
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
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
5answers
67 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
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
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
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
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
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)...
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
19 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-...