Tagged Questions
0
votes
0answers
20 views
Keyup/Keydown/Keypress events not firing in Internet Explorer 11
I'm using a mixture of JS key events and AngularJS to prevent the user from entering non-numeric keys in an input field (via a directive). While the following works in Firefox and Chrome, Internet ...
0
votes
0answers
6 views
svg genrated with angular ng-repeat is not rendeerd
I'm trying to generate some svg element trough angular ng-repeat
I created one directives that should just import the template
this is the code with the ng repeat
<svg width="600" height="600" ...
0
votes
0answers
6 views
angularjs: Unit testing with simulate click
I'm unit testing a directive, and I have something like this
<bar-foo>
<a ng-click=show = !show">click me</a>
</bar-foo>
var scope = el.isolateScope();
...
0
votes
1answer
16 views
multiline template in directive definition
I am trying to make a directive template multiline. Is this possible?
myApp.directive('myDir', function() {
return {
restrict: 'E',
template: '<div>
|Hello,
...
0
votes
1answer
26 views
How to execute a sequence of events in Angular using $timeout
I have a div in my view, I want to execute a function on ng-click() which turns the background for the div to 'color a' for 30 seconds if there's no action taken then for 60 seconds then change to ...
2
votes
1answer
21 views
Angular: Call directive controller function from separate controller
Let's say I have an app called myApp. There is a directive for a menu component. This directive has a controller defined on it. Now, from another controller that loads the view, I want to call methods ...
0
votes
2answers
18 views
pass arguments to a function call in a directive via angularjs
I have a custom directive. In my html i write this:
<uploader action="/rest/file/create_from_form.json" success="writeFid()"></uploader>
What I need is to exec "success" attribute ...
1
vote
1answer
18 views
How do I properly build an AngularJS labeled radio input directive?
I realize that AngularJS already has an input[radio] directive and I want to leverage that as much as possible.
I created a JSFiddle here, but I can't figure out how to get the ng-model property to ...
0
votes
1answer
22 views
Compile Service with Angular
I want to create html based on variables, I created a directive and called "node", and I wanted to use it as a template to generate markup based what attributes are passed into the directive. However ...
1
vote
0answers
30 views
How to separate functionality of Angular directive
I have this extend text component which can add auto complete, tagging, and search query capabilities to a input/textarea (which can work independently or together). Instead of having all the ...
0
votes
0answers
11 views
how to code to get the file to open in pdf format in angularjs
Hi I am really new to angular and trying new stuff.
I have a button which says download pdf and on clicking this the file should open in the new window in pdf format.
How can this be achieved the ...
0
votes
2answers
16 views
Angular directive to add content rather than overwrite
I am trying to write a directive that will show a "loading" message over a div while the data is fetched from the server.
Thus far I've managed to get this:
.directive('dataLoadingPanel', function ...
0
votes
1answer
23 views
AngularJS value not passing to directive
I am using ngTagsInput which has an auto-complete feature. It seems to be working very well. My problem is I want to know how to pass the query from source="loadTags(query)" into the directive, but ...
0
votes
0answers
20 views
Simple “pager” directive
I've created some simple pager:
index.html:
<div class="container" ng-controller="NewsCtrl">
<ul ng-repeat="news in newsList">
<li ng-show="$index < count">{{ news ...
0
votes
0answers
20 views
How to add an AngularJS directive to the element object during a directive's link function?
I built two custom directives, datepicker and date-validation, and I'm having trouble with getting datepicker to include the date-validation directive. At first I had the datepicker and date ...
1
vote
3answers
42 views
AngularJS Directive for specific tag name
How can I force specific tag for a directive in AngularJS?
For example, I want to create a directive that will be applied only on <img> tags. If the user put this directive on a <div>, I ...
0
votes
3answers
33 views
How to prevent anchor default in dynamic ?
Demo
According to ng/directive/a,to prevent the anchor route is <a></a> or <a href=""></a>,and yes, it works but not for dynamic content.In the demo above show the generated ...
-5
votes
1answer
29 views
how to add selected value of drop down list item value stored in html table in angularjs [on hold]
Please give me sample program with work out in plunker. My code is
function List($scope){
$scope.list_array=[
{number:1,name:'A'},
...
1
vote
1answer
24 views
AngularJS - get original element from ng-click
I have a list of items in my view with ng-click attached to them:
<ul id="team-filters">
<li ng-click="foo($event, team)" ng-repeat="team in teams">
<img ...
1
vote
1answer
17 views
what will be the scope of scope variable in link function in angular?
var $directive = angular.module('myApp', []);
$directive.directive('myDirective', function(){
return {
restrict: 'E',
template: '<h4>{{title}}</h4>'
compile: ...
1
vote
3answers
30 views
Angular.js <input type=“date”> change format of submitted value
<label>From</label>
<input type="date" ng-model="startDate"/>
<label>To</label>
<input type="date" ng-model="endDate"/>
<button class="btn btn-success" ...
0
votes
0answers
24 views
Angular directive for generating directives
I have a screen in my app which should show a list of components. Now, components can be different, showing different HTML content and with varying behaviour.
So, what I need is to do an ngRepeat, ...
0
votes
2answers
36 views
Angularjs- adding/removing dynamic html elements (dropdown)
here is my code-
http://plnkr.co/edit/oTWXbLIKOxoGTd4U0goD?p=preview
why is the days dropdown does not data bind with scope.demoDays, it is always empty?
is this the correct way to add dropdown ...
2
votes
1answer
96 views
Can I access compiled node data in a custom AngularJS directive?
I'm trying to write a directive that checks the value of the content inside it to decide if certain classes should be applied to the element, and to format the content (probably by forcing the content ...
0
votes
1answer
22 views
How to remove the class from angular-bootstrap modal
I am using angular-bootstrap modal and trying to remove the slide down effect when it is closed.
I tried to remove 'fade' class like this, but it didn't work.
angular.module('myapp.directives', [])
...
0
votes
2answers
23 views
Why doesn't scope pass through properly to nested directives?
In this example plunker, http://plnkr.co/edit/k2MGtyFnPwctChihf3M7, the nested directives compile fine when calculating the DOM layout, but error when the directive tries to reference a variable to ...
0
votes
1answer
12 views
Post request is not working in angularjs - Resource services
I'm trying to send the post request to server with post data
it's sent the request to the server, but not in right format
request url like ...
0
votes
0answers
22 views
Resize table columns using AngularJS
I would like to implement resizable table columns, such that when you click and drag on a "notch" on the right side of the th (just a styled div inside the th), a new "marquee" element is created ...
0
votes
1answer
17 views
Directive scope is not refreshing when provided value will be assign to directive scope
I created my own directive in angularjs and I noticed that directive scope is not refreshing when I change scope in main controller.
I made simple example which after 3s changing scope value, but ...
0
votes
1answer
39 views
Angular - condition, transclude
I've written a sample directive with a conditional content (component.html):
<div class="panel panel-default">
<div class="panel-heading">{{title}}</div>
<div ...
2
votes
1answer
33 views
How do you access a child of ng-repeat item in a directive's scope?
I have just started using AngularJS. I would like to access to a div.item inside my ng-repeat but it doesn't work.
EDIT : When I click on addtime, the new item should be positioned in accordance ...
1
vote
2answers
30 views
Pass argument from controller to service in angularjs
I'm facing the problem on passing the argument from controller to service module
I don't know where I have pass the arguments in controller module and how to get the value in service module. here is ...
3
votes
2answers
40 views
How to call a directive from an another directive in AngularJS?
I have just started using AngularJS. Is there a way to use a directive from an another directive ?
I would like to add new <div time></div> on click on the parent.
EDIT : index.html
...
2
votes
1answer
29 views
Angular.js how to build dynamic template parts using directives with isolated scope
I've got a directive... like so:
.directive('formMenuBuilderMenu', function (formMenuService) {
return {
templateUrl: '../../views/templates/formmenubuilder-menu-template.html',
...
0
votes
0answers
19 views
Angularjs Separating Directives from Controller files into own modules [on hold]
I am new to AngularJS and recently introduced it into my application. I am trying to modularize my code specifically taking my directives out of my controller.js files and into their own directives.js ...
0
votes
1answer
23 views
Directives interaction: require vs. events
I am playing around with AngularJS directives. While focusing on interaction between parent/child directives. I stumbled upon two different approaches, and I was wondering which one is better. Let me ...
0
votes
1answer
20 views
how to get headers from response in angularjs
This is my sample, i'm not get response headers, it returns undefined
I'm trying to get custom response headers like reponse.header['X-auth-token'] but it returns undefined
I'm new to angular js, ...
1
vote
1answer
17 views
Angular JS formate date
Is there any directive in Angular, I want to enable user when he write 2/3/67 in input for date date needs to be formated like 02/03/1967 I tried few things my own but they dont worked.I dont even ...
0
votes
2answers
26 views
angularjs if/else statement and window width
I am new to AngularJS and recently introduced it into my application. I am trying to re-write some of my existing jQuery code in my controllers, however, on one occasion, i am using:
jQuery:
if ...
0
votes
0answers
19 views
angularjs: one directive in another, inherit or share it's isolated scope
The origin problem is: I want to create a directive to process field checking automaticly, the result should be like this:
<div field-check="check.item_name">
<span>Item ...
0
votes
1answer
33 views
Angular directive - when to prefer using a controller inside a directive?
I've been seing a lot of directive containing a controller in it. What are the pro / cons /differences and use cases compared to put the same code in the link function of the directive ?
One ...
0
votes
0answers
8 views
ng-grid is loading twice when i use sorting on specific field
Following is the sample code that i used. in that code when i click on the field name at that time it ajax call will run twice. is there any solution for that ?
$scope.totalServerItems = 0;
...
0
votes
0answers
31 views
Performance issue when angular directive is called more number of times on page
I have created an angular directive which is for adding span tags of error messages below input textboxes. I wanted to reduce the lines of codes so made an angular directive for that.
Now the ...
0
votes
0answers
24 views
service for editing part of an agular model
I have the following set of directives to construct a nested list.
this is to build a hierarchy of products in categories.
myApp
.directive('sections', function() {
return {
...
2
votes
1answer
32 views
Angular. Generate directive inside directive. Where is my scope stuff?
I am trying to generate multiple expressionSelect directives inside my expressionAuthoring directive, in this case, on a simple click. I can get the expressionSelect template to appear, but with none ...
0
votes
0answers
28 views
AutoComplete using ngTagsInput Cannot Read Property 'then' of undefined
I am trying to figure out this problem but I am having no luck.
This is the plunker I wrote that works. Notice that the code works perfectly when I am accessing tags.json using a $http.get.
Angular ...
1
vote
3answers
45 views
Update AngularJS scope variables in the view
I have the following AngularJS controller function which makes a JSONP request to a webservice, gets the data as a JSON file and assigns the values to scope variables which I show in the UI by ...
0
votes
1answer
19 views
Does ng-repeat recreate all child DOM elements when new data is appended to the array?
I created a directive that handles infinity loading of blog posts as the user scrolls down.
I'm wondering how AngularJS handles the addition of new blog posts when the feed is rendered using ...
0
votes
2answers
26 views
AngularJS directive dynamic templates
Sorry, maybe it's stupid question but i'm still learning.
I'm trying to make directive with differtent templates based on scope value.
This is what i done so far which i don't know why doesn't work ...
0
votes
0answers
12 views
Angular parse markup to ignore tags (contenteditable)
I am working on a directive to do some replication/workaround stuff which acts like an inherit contenteditable div, but as a contenteditable directive. I looked into $sce on the official docs and html ...