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.
0
votes
1answer
4 views
Can I add a property on a directive I created afterwards the page is loaded based on IF condition?
The directive is a attribute (A) one.
HTML:
<input class="form-control" my-amount-field amount-min="5" amount-max="120" shouldBeingChecked="{{crCtrl.form.canCashM}}" name="myLimit" id="myLimit" ...
1
vote
1answer
25 views
Show custom directive in ng-repeate every 10th element
I want to display banner after every tenth element in ngRepeat and change it depending on filters(currently I didn't implemented functionality for changing, but I listen for changing event). I've ...
0
votes
0answers
12 views
objects inside ng-bind-html does not respond to directives or css
I've implemented fitvids for angular: https://github.com/jimmyhillis/angular-fitvids
When I add the fit-vids directive to a div surrounding or the one containing the ng-bind-html it does not work.
...
0
votes
0answers
14 views
SelectOrDie - JQuery as directive
I want to build http://vst.mn/selectordie/ as Directive in my angular application.I referred few samples, tried but I couldn't get it done.
var app = angular.module('selectordie', []);
...
0
votes
0answers
19 views
AngularJS nested directive priority with ngRepeat
I have a case where I have a child and parent directive. I need to run a function on the parent once all the child directives have been processed. I would expect to be able to do this in the parents ...
0
votes
2answers
18 views
Unable to call parent controller method from directive
I've seen the many, many, many, many questions on this problem but for some reason I still can't bind ng-click in my directive to a method on the parent controller. I'm pretty sure I've got my scope ...
2
votes
2answers
19 views
Set directives options globally
How to set the values of directive options such as (restrict, replace) with default values instead of re-configure them for each directive.
0
votes
2answers
19 views
Accessing $rootScope variable from a directive
So I have a directive that look like this:
(function (module) {
var node = function (RecursionHelper) {
return {
restrict: 'E',
controller: 'mainController',
...
0
votes
1answer
15 views
angularjs create tree structure without recursive json data, based on just current node id
i have stored data like this
database json
<div ng-controller="AppCtrl">
<script type="text/ng-template" id="childshow">
{{s.Folder_Name}}
<ul>
<li ng-repeat="s ...
0
votes
1answer
14 views
Is there any event before $locationChangeStart?
I want to re-init a service variable before every page loaded.
It seems $locationChange cannot match this needs in some condition
angular.module('xxx')
...
.service('xxxsvc', [..., function(){
...
0
votes
1answer
22 views
iterate through sub-objects of ng-repeat with dynamic key value pair
I have a JSON object and I am iterating through this.
But, each iterated object has some child objects where I do need to iterate through them as well.
JSON structure:
[{
'name': 'a',
...
0
votes
1answer
16 views
Dynamic custom Angular directive/$compile not working with .innerHTML()
I have a timer application. When the countdown timer gets to a certain number, the timer will stop and a div tag will be created within another div tag using .innerHTML(). This div tag contains a ...
0
votes
0answers
16 views
Angular Image Zoom Effect
I am trying to replicate FluidBox jQuery Image zoom effect using angular directives:
http://terrymun.github.io/Fluidbox/demo/index.html
When an image is clicked, it zooms up from inline to an overlay ...
0
votes
0answers
8 views
In angularjs how to validate only a specific inner area of the page without triggering complete form validation
Background:
I have a large massive page where I have lot of tables. If a user clicks on the edit link next to a table then I show the fields of the table as editable within a bootstrap modal.
And my ...
0
votes
0answers
27 views
check if directive with given name exists, angularjs
Is there a way of checking if an directive in angular exists?
What I want to do, oder better what I have:
A Collection of 'protocols', which share some similarities, such as: name, created by, last ...
-1
votes
0answers
19 views
How to convert “jquery code” on “angular code”?
How to convert "jquery code" on "angular code"?
I'm using the "sb-admin-2 bootstrap "template, in "AngularJS Fullstack" with "Grunt" (grunt serve).
I'm learning and I am self-taught. I have trouble ...
0
votes
1answer
23 views
How to access parent directive controller?
I have two directives, say dir1, dir2.
dir1 is some common directive.
I transclude dir2 into dir1.
Here is the script:
<script>
var app = angular.module('myapp', []);
...
1
vote
1answer
14 views
passing object trough directive scope not working
I am trying to pass an object from a controller via my HTML template to a directive to use the object in another HTML template.
I got an controller with:
function controller($state, $rootScope) {
...
0
votes
2answers
14 views
Use of quotes for angularjs- directives
I'm practicing writing AngularJS app using modules and embedded HTML. Does anyone know why the source of the ng-include directive below requires single quotes inside double quotes, while the source ...
3
votes
1answer
26 views
Unit Test Karma Jasmine SyntaxError: Parse error on “&” Angular Directive binding
I get SyntaxError: Parse error at my directive line where I want to use a "&" one-way binding from a parent directive's method
myApp.directive('datasourceDeleteBtn', [function() {
return {
...
0
votes
1answer
15 views
Error: [$compile:ctreq] Controller required by directive , can't be found
I keep getting this error from a directive that requires another directive. What I don't understand is that this code works on other pages without issue. here is some code:
The directive that is ...
0
votes
1answer
23 views
Rendering Order of Angular Directives with templateURL
I have the following scenario, simplified in jsFiddle
I'm trying to run some code in the parent wizard element, after all steps in it rendered. in this context, console logs are generated as they ...
0
votes
4answers
20 views
separate angular directives
I am exploring angular directives. I have created 2 simple ones following this example taken from
http://blog.revolunet.com/blog/2013/11/28/create-resusable-angularjs-input-component/
...
1
vote
0answers
11 views
Directive with transclude 'element', thorws an error when applied on select
I try to create directive which simply copies transcluded content.
The only constraint is that I would like to use transclude: 'element' option. Directive has following structure:
...
0
votes
0answers
11 views
Angular directive link function with custom service in TypeScript
I'm looking for a way to implement an angular directive with link function the TypeScript way. Say, I want to have a directive who will get injected with a custom service and I want to be able to use ...
0
votes
1answer
12 views
Using ngAside for opening a simple left-menu Modal
I just want to test opening a left modal with the help of ngAside used at the following Repository:
https://github.com/dbtek/angular-aside
I think I am doing it right, still can find a js error. ...
0
votes
0answers
13 views
Ionic list divider text is not being updated correctly
I am building an Ionic app which has a list that is split using 'item divider'.
The problem I am having is that when I use the buttons I have in the app to change the list order etc. the divider text ...
1
vote
1answer
45 views
How to set focus for next tab in angularjs?
Example File Link
Hi all,
Here I created sample for tabs. What I exactly need is, in this sample i am doing validation with entering anything click submit the focus will go to invalid text which is ...
1
vote
0answers
24 views
How to create a lightbox similar to facebook using owl-carousel in angularjs?
This is the code I'am using for owl-carousel in angularjs:
index.html file:
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
...
0
votes
1answer
13 views
link function of AngularJS directive never called in Jasmine test
I don't understand why the link function of my directive never gets called in an Jasmine test. I made a simple example.
Here is my directive (TestDirective.js):
'use strict';
...
0
votes
0answers
13 views
Detecting the appearance of an overflow:auto vertical scroll bar on a DIV in angular JS
Hi I'm making a custom table in angular js, using a variety of directives for the various parts of the table.
I currently have a table body directive that needs to watch whether it has a vertical ...
1
vote
1answer
49 views
Show last three characters of a password with angularJS
I'm currently developping a mobile app with Ionic framework and AngularJS.
In my login page, the user's account name is loaded on his second connection (and is considered as a password field). ...
0
votes
3answers
27 views
angularjs: injecting async service into directive with $resource
I'm very much trying to get my head around angularJS and directives still.
I have an existing REST service that outputs JSON data as follows (formatted for readability):
{"ApplicationType":
...
0
votes
3answers
41 views
AngularJS: Dynamically binding Click in directive gets fired multiple times
I'm trying to add fields dynamically and I'm binding click event in the directive's link function. But it seems to be firing several times as I add more fields. See the example below -
var clicks ...
0
votes
2answers
34 views
How to change Selected Tab inside controller in angularjs?
Here I created Sample For Tabs.
What I exactly need is inside sample controller manually I need to set selected tab based on config parameter. At load time I need to set manually the tab to be ...
0
votes
2answers
22 views
How to use directive-defined events to update my model
I am creating drag and drop functionality by creating a <dragItem> directive and a <droptTraget> directive, but I don't understand yet how to work with the inner and out scope in this way.
...
0
votes
1answer
32 views
Angularjs, function not being properly invoked inside controller
I'm doing this login exercise where users can login and post notes, and view the notes that they've posted. My problem is when I logout and login with a different user I see the notes from the ...
0
votes
2answers
24 views
My directive's 'template:' binding works but 'templateURL:' binding fails
I'm working to make a calendar that I can drag and drop values into. I use ng-repeat to create a drop target for each day. It repeats a directive <drop-target> which you can see below. When I ...
0
votes
1answer
43 views
Variable value not passing in a controller using directive with ng-class
I am referencing the value of the variable in a controller in an ng-class template but its not working.
here is the html directive template URl :
<div class="tooltip-anchor">
<div class=" ...
1
vote
1answer
18 views
Calling an angular directive via append method
I'm trying to call an angular directive with html text I am appending in my controller like so,
var loadReviews=function(){
var theDiv=$("#rlist")
for(var i=0; i<vm.reviewlistByUpvote.length; ...
0
votes
0answers
6 views
how to import angular-slider with webpack
I was trying to use this nice angular slider library with webpack.
First I npm install it.
Then
import slider from 'angular-slider';
require('angular-slider/slider.css');
Finally
...
1
vote
0answers
24 views
Using expressions inside an ng-option tag in custom directive
I am trying to create a custom directive like this:
app.js
sampleApp
.directive("selectDirective", function() {
return {
restrict : "E",
templateUrl : "directive.html",
...
0
votes
0answers
23 views
AngularJS nested directive layout
I have two different directives, called container and content.
The HTML code of the container is as follows:
<div class="row">
<div class="col-sm-12">
Content 1
...
2
votes
0answers
14 views
AngularJS - ngAnchorScroll not scrolling
I am trying to use the directive ngSmoothScroll to scroll to a particular element in a webpage. You can find the directive here: https://github.com/d-oliveros/ngSmoothScroll
I have included the .js ...
1
vote
0answers
18 views
Angularjs: How to correctly compile a custom directive inside a factory?
I have a custom angular directive called list.
<my-list data-enabled="true" readonly data-selected-item="value"></my-list>
And I have a factory that is used as formatter/renderer ...
0
votes
1answer
36 views
AngularJS Linky set ng-click on all links
I'm using AngularJS linky filter to make links on a snippet, and it works great, but I want to make call a custom function before executing the url.
So my question is, how can i set a ng-click ...
0
votes
0answers
46 views
AngularJS Custom Directive Isolated Scope is not working
I'm trying to create a Spinner,
I have a custom directive in AngularJS
var app = angular.module('plunker', [])
.directive('spinner', function() {
return {
restrict: 'EA',
scope: {
...
0
votes
1answer
29 views
angularJs Form valiation with dynamic error message
I want validate a form where for each input may have many error messages as per input. I want to write those error message from javaScript.
HTML
<input name="username" ng-model="user.username" ...
0
votes
1answer
24 views
AngularJS - how do you associate a controller by path after compiling the html?
Is it possible to dynamically associate a controller, after it has been compiled from a template?
//Controller /path/ctrl/MainCtrl.js
angular.module('app')
.controller('MainCtrl', function () {
...
0
votes
0answers
16 views
scope methods in link function of directive not getting called
Below is the directive that I have created
angular.module('bahmni.common.conceptSet').directive('concept',
function(){
var link = function (scope, element, attributes) {
scope.cloneNew = ...