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
19 views
Get a combined string from an Angular custom directive with a list of input boxes
I'm a newbie to Angular. Enjoy the fun of learning new things currently.
Here is my intention - I would like to have a list of input boxes. And then I want to get the combined string value from user ...
0
votes
1answer
9 views
AngularJS and FancyTree: Events firing, but with undefined parameters
I'm trying to write a directive for fancytree. The source is loaded through ajax and almost everything looks like a charm. The tree is correctly shown, events are firing nice, but the parameters get ...
0
votes
0answers
9 views
Angular directive not working using Yeoman
I am trying to test a directive created with the following
yo angular:directive countriesDirectives
this is the resulting directive with some changes
'use strict';
/**
* @ngdoc directive
* ...
0
votes
1answer
21 views
AngularJS - Add DOM elements on counter++
I'm quite new to AngularJS and have read a little bit about how directives work. I'm still not quite sure about how to go about this problem though.
Here's the setup:
I have buttons on a view like ...
0
votes
1answer
27 views
Why is the ng-class directive being compiled after my custom directives
Link to plnkr for example explained below: http://plnkr.co/edit/oYvwHnAIvFb4rUqqwsz3?p=preview
Hi, I dont understand why angular is compiling my code this way and need some help understanding why it ...
0
votes
0answers
18 views
directive post link function - focus on element once it's visible
I have the following directive to allow focusing on an element:
angular.module('app').directive('focusOn', ['$timeout', function ($timeout){
return {
scope: {
focusOn: ...
0
votes
0answers
10 views
Angular Input Restriction Directive - Negate Regex ngModel $parse
I'm trying to create an Angular Directive that limits the characters input into a text box. I've been successful with a couple common use cases (alphbetical, alphanumeric and numeric) but using ...
0
votes
0answers
20 views
how sorting work in angular ascending and descending order?
could you please tell me how to sort column in ascending and descending order when user click on header of each column .I have list in which header is placed on top .I want to sort my column using "^" ...
3
votes
2answers
26 views
AngularJS replaced directive on specific pages?
I have an index.html with the main view and 2 directive, on for the site header and one for the footer:
<div class="site">
<!-- header -->
<header pb-ds-header ...
0
votes
3answers
24 views
Add a placeholder to angular {{}}
I have got this editable directive and it works lovely except it wont show text until the model has data inside it.
The method I have tried is this:
{{option.title | Test}}
I was hoping this would ...
0
votes
1answer
29 views
How to declare Common method for multiple directive in Angularjs
I have three lines of similar code in multiple directive, which is actually doing some bind an event handler to the "focus".
var ele = $(event.target);
$($(event.target)).attr('tabindex', -1);
...
0
votes
0answers
17 views
How to migrate “attribute kind of directive” from angular1 to angular2?
For example:
<input min="2" max="10" type="text" /> <!-- directive: min and max -->
Learning angular2 now, find it so amazing! But don't know a proper mapping in angular2 for attribute ...
-1
votes
0answers
25 views
Call angularjs directive using a string
Lets say I have a directive called "myDirective".
Can I call this directive through a string?
Something like
$eval("myDirective")
instead of using
my-directive()
[]'s
Tks
0
votes
0answers
34 views
Angular directive inside ng-repeat bound to wrong element
All,
I am using django, django-rest-framework, angularjs, and django-angular to build an overly-complex website.
I have an accordion, where the accordion groups are set using ng-repeat. Inside each ...
0
votes
0answers
12 views
How to loop through the data in angularjs and customizing the template via custom directive?
I haven't understood directive in angular completely, and not sure exactly how I'm supposed to pass the value to the ng-model in the template. So, let me just give you what I have. First off, json ...
3
votes
3answers
43 views
Uncaught Error: Module 'myApp' is not available! (AngularJS)
I'm working on angular tutorial and i'm having a problem on beginning. Loading myApp module throws error. As explained in tutorial, this should be one of three ways to create controller.
Here is print ...
1
vote
0answers
47 views
Enable/disable a button based on inputs' validations
I have this jsfiddle. Can someone please help me on this.
http://jsfiddle.net/ash12/kk1s3a1d/27/
HTML Code
<div ng-controller="ListController"><br>
 File:
...
0
votes
0answers
9 views
Angular Bootstrap DatePicker Directive (Eternicode version) not staying open
I'm working on integrating Eternicode's Bootstrap Datepicker into my app. I wasn't sure how to connect it to my model so I found a directive that uses it from here. Now I've got the datepicker on my ...
4
votes
2answers
43 views
Ng-Model=“something.$” what does this mean?
I'm new to Angular and I was reading over the filter documentation and I saw this code.
<label>Any: <input ng-model="search.$"></label> <br>
<label>Name only ...
0
votes
1answer
19 views
How to modify content from an ngInclude
I have searched the question/answers and it seems as if I should use a directive. I would however prefer to use the well tested ngInclude. The scenario is:
I am using ngInclude to fetch an external ...
0
votes
0answers
17 views
ionic shake animation of an menu item
Why the shake animation is not working for my menu item (which has the count)?
I have the following template for the menu:
<li class="item" ng-repeat="(key, value) in menuItems">
<a ...
2
votes
0answers
17 views
Defining and registering Angular directives in a 1.x ES6 project
I have been working on an Angular project that uses all ES6 syntax with babel-node doing the transpiling. This works nicely for controllers and services, but I'm uncertain how best to write directives ...
1
vote
0answers
20 views
AngularJS inject $timeout to a link?
So here is what my issue is:
i have a directive:
autocompleteDirective.$inject = ['$timeout'];
function autocompleteDirective($timeout) {
return {
restrict: 'E',
scope: {
...
0
votes
0answers
20 views
AngularJS: Directive template not getting rendered completely before calling link function
I am creating a directive that will basically tabulate passed in data. Here is the directive template-
<div class="i_b" id="colorful-table">
<table class="table table-bordered">
...
0
votes
1answer
16 views
trigger click event and add params to it - angularjs
Similar to what this user is trying to acheive:
manually calling click() on a button, can I pass any parameters?
I would like to do the same in angular JS.
Something like:
...
0
votes
0answers
21 views
how to access dynamic key and value fields while use select option with ng-repeat using angularjs directive
I have mention code and jsfiddle link below. This directive for dynamic select2 drop
down element option. Here {{tag.optionKey}} is not get dynamically. for example, if i gave option-key="type", ...
0
votes
2answers
34 views
accessing directive variable from parent's parent controller
I have a case using kendo editor.
First controller
app.controller('FirstController', ['$scope', function($scope) {
$scope.Html = "<div> Hello World</div>";
}
2nd Controller For ...
0
votes
0answers
18 views
how to set key field as dynamic in select2 dropdown using angular directive
i want to run dynamic data through ng-repeat and set dynamic key
values, like below,
in directive scope:
K
optionKey : '@',
optionValue : '@'
in my template:
...
0
votes
0answers
22 views
Need clarification of angular architecture for editor
Edited: Tried to simplify the posting
I need to create a simply github-flavored markdown "editor" with the following basic (typical) features
Preview panel that shows converted markdown text
An ...
1
vote
1answer
12 views
change the content of an iframed page in Angularjs
I need to dynamically iframe various html pages in AngularJS and then change parts of their html content. I have created a directive and it iframes just fine but my problem is that I can't access the ...
0
votes
2answers
23 views
AngularJS directive doesn't set 2nd level of scope object
I'm using a directive to read json data from a <script> element, this works fine as long as my ng-scope is a first level property like data. For some reason I'm not getting the data in 2nd or ...
3
votes
3answers
24 views
AngularJs, $scope.variable is undefined in a directive
In my html file , I use a directive which is a searchBox:
<ng-lms-search-box searchType="Author" maxResult=5 data-ng-model="searchText"> </ng-lms-search-box>
And this is the function ...
0
votes
1answer
17 views
What is the scope of templates bindings in a directive without a controller
Here is a simple angular application. It shows/hides a text based on user clicking a button.
<div ng-controller="exampleController as ctrl">
<example></example>
</div>
...
0
votes
3answers
32 views
AngularJs external file controllers and directives: how to write them correctly?
I have an app.js file where I specify my dependencies:
angular.module("myApp", ['angular-jwt', 'chart.js']).config(...)
I want an external file for directives, so in directives.js I write:
...
0
votes
1answer
37 views
Refresh html table data at regular interval using Angularjs
I'm trying to refresh the html table data for every ten seconds by invoking GetTicketDetails method using $interval service, but my view is not reflecting the changes. Below is my Java Script Code ...
0
votes
1answer
19 views
Shared scope of a directive when 'controller as' syntax is used
Here is a simple example of using directives (adapted from the official guide)
- JSFiddle
<div ng-controller="Controller">
<my-customer></my-customer>
</div>
...
0
votes
0answers
5 views
drag to crop functionality in ngImgCrop in angularjs
Using ngImgCrop in angularjs for cropping the image and its working fine. After uploading the image automatically showing the crop area like this:
But I need something like Jcrop cropping, means ...
1
vote
2answers
27 views
AngularJS directive: parsing array from string in one way binding
I was creating a one way binded directive which had an attribute containing an array as follows:
app.directive('interestBox', function() {
return {
restrict: 'E',
scope: {
...
1
vote
1answer
28 views
“this” vs. $scope in angular
I know similar questions have been asked, and I have read the answers, but I still don't get this, so any help will be appreciated.
The code below works. However, if I use $scope instead of this ...
0
votes
1answer
20 views
ngMessagesInclude doen't work in ngMessages directive
Includes:
angular/angular.min.js
angular-route/angular-route.min.js
angular-messages/angular-messages.min.js
This is my module.
var axipay = angular.module('axipay', [
'ngRoute',
...
1
vote
1answer
21 views
AngularJs directive with ControllerAs and TypeScript Class
I've written a AngularJs directive with TypeScript to Copy modelValues to the clipboard and the "old" $scope version for directives works fine so far:
module App.Directives {
interface ...
0
votes
2answers
35 views
Angularjs how to resolve unknown provider error in a directive
I am getting the following error in my meanjs app -
Error: [$injector:unpr] Unknown provider: $scopeProvider <- $scope <- uiJqDirective
...
0
votes
0answers
27 views
Using $location for only part of a page breaks back button
I want to use $location to navigate a self-contained comments section on a normal statically loaded page, but it seems to break the back back button.
The problem comes when I've navigated to a few ...
1
vote
2answers
31 views
Call a function from a directive to the controller
I am trying to implement a simple comment writing from client to server using angular.
Here is the HTML for the comment form:
<form id="commentsForm" name="commentsForm" ...
6
votes
1answer
37 views
$emit vs callback in parent child directive communication best approach
Im trying to understand what is the best GENERIC approach to communicate between parent and child directive with isolated scopes (they might be reusable items).
meaning if child directive needs to ...
-3
votes
1answer
37 views
how to install grunt sass in angular js?
I am trying to use grunt in my first angular project .I am trying to use sass in my project .I follow all steps of this link
...
0
votes
0answers
21 views
TypeError: Cannot read property 'hash' of undefined
I am facing an error while i am trying to call the following angularjs method with id and $event as parameter
$scope.gotoLink = function(id, $event) {
$event.preventDefault();
...
1
vote
0answers
26 views
Wrap ag-grid in an Angular Directive
I am creating a wizard to add a new appointment in our application. The last page of the wizard contains a tabbed section with all potential conflicts based on several criteria. Each tab is one of ...
0
votes
0answers
13 views
Testing a blur event inside a angularJS directive with jasmine
The following are some test code for a directive:
The first one works
it('should send formView message', function () {
markup = '<form name="form" ng-app="sharedUiModel" ...
0
votes
2answers
45 views
AngularJS - What is expected behaviour of two directives with the same name but in different modules?
Of course, I can check it myself.
It's more conceptual/architectural question and why it was build so.
angular.module('appmodule1').directive('mydir', function(){});
...