Tagged Questions
2
votes
2answers
23 views
Can an angular directive pass arguments to functions in expressions specified in the directive's attributes?
I have a form directive that uses a specified callback attribute with an isolate scope:
scope: { callback: '&' }
It sits inside an ng-repeat so the expression I pass in includes the id of the ...
0
votes
0answers
23 views
How to get the rendered html by AngularJS?
how to get the html rendered inside a div, after it is rendered and put it inside the scope of controller ?
I am new to angular and though i know the basics of directives i cant seem to get the ...
2
votes
1answer
23 views
autoscroll angularjs doesn't seem to work
Hi I'm building a chatapp in angularjs and I want the chatbox to scroll down automatically. I'm using this example that I put in a directive: http://jsfiddle.net/atRkJ/
It works as it is but when I ...
0
votes
2answers
37 views
What is the opposite of `ngDisabled`?
In AnguarJS, is there a directive that is the opposite of ngDisabled? So instead of writing:
<input ng-disabled="{expression}">
...
</input>
I can write:
<input ...
1
vote
0answers
21 views
Form Validation and fields added with $compile
I have a question regarding form validation. It is not working for me in the following scenario:
I have a global form, inside the form dynamic fields are rendered using a directive. That directive ...
0
votes
0answers
20 views
Dynamic value in ng-minlength
I have a constant called Config which contains a task.minlength = 3 attribute.
I'm appending the constant in the $rootScope:
.run(function($rootScope, Config) {
$rootScope.Config = Config;
})
...
0
votes
0answers
9 views
Update ngModel on callback from FineUploader in Angular.js with ngModelController not working
i know this question have already been asked, but i have the exact same issues and the answer provided is not working for me.
link : Update ngModel on callback from FineUploader in Angular.js
I have a ...
0
votes
1answer
19 views
Angularjs custom directive highlight text after ng repeat has run
I want to create a directive that hightlights text( using jquery highlight plugin), after ngRepeat has rendered all its items. Consider following html:
<div data-hightlight="" ...
0
votes
1answer
24 views
Angularjs Directive - Isolated scope value is undefined
I am a newbie in angularjs. I am little confused about isolated scope in directives. I have the following code,
HTML
<!doctype html>
<html ng-app="myApp">
<body ...
0
votes
0answers
16 views
Autoscroll down angularjs
Hi I'm creating a chat app with angularjs that autoscrolls down when a user messages another user. I'm not sure how to implement this as my chat window is a fixed ul element. I'm thinking I will ...
0
votes
1answer
33 views
Creating a new html page from controller
I have an input form page, that when the user submits, it updates that page with some tables of data. If the user likes what they see, they should be able to print a cleaned up (no header nav, footer ...
-1
votes
1answer
22 views
AngularJS Tree Directive Recursive Errors
I'm implementing angular-bootstrap-nav-tree directive in my application inside of a partial. When I do the most basic example I get:
TypeError: Converting circular structure to JSON
at ...
0
votes
0answers
4 views
$httpBackend prevents normal angular routing; how do I configure $httpBackend to allow normal routing behavior?
I need to load up $httpBackend in order to mock out $http server calls (which return JSON). I've defined my own mocks, but when I load up my angular app with $httpBackend and my own mocks, I get an ...
0
votes
3answers
44 views
AngularJS Directive Numeric Format Masking
The directive I have created uses the function setFormatting to mask the text value in an input field.
scope.$watch(element, function() {
modelCtrl.$setViewValue(setFormatting(element.val(), ...
0
votes
1answer
17 views
Reset the scope using an onclick event with AngularJS
I have a scope variable that gets set when a user clicks an element. I would simply like to change that variable to false when a user clicks outside the element. Common convention for modals or popup ...
0
votes
2answers
36 views
Talking to Angular Directive from Controller
I have a directive and I want to call a method of the Directive from outside controller . That means when I click a button in the main controller , I want to hide a component in the directive . Is ...
0
votes
1answer
20 views
Angularjs directive clicking elements
Hi I was wondering when I have a list of elements from a ng-repeat, how I can allow the user to click one of the list and make it highlight via .css(). Then if the user clicks another element, the ...
1
vote
2answers
48 views
Angularjs isolates scope directive with ng-repeat
I'm trying to use directive on ng-repeat items each with an isolate scope but it isn't working. I'm looping through each item and coloring it red with the inboxuser-select directive. However, when I ...
0
votes
2answers
29 views
Why ng-hide don't work with custom directives?
I'm reading the directives section of the developers guide on angularjs.org to refresh my knowledge and gain some insights and I was trying to run one of the examples but the directive ng-hide is not ...
0
votes
1answer
26 views
Unable to print scope variable inside ng-repeat
I am trying to associate id inside an ng-repeat loop. Can someone suggest how can i do this?
here is the code
<li ng-repeat="agent in agents">
<chart ...
0
votes
0answers
14 views
Not able to debug in firefox when using $timeout in directive
When I am debugging in firefox and debugger is supposed to enter the directive :
dialogApp.directive('myTable', function($timeout) {
return function(scope, element, attrs) {
$timeout(function(){
...
1
vote
0answers
24 views
Passing an angular format expression to a custom directive attribute
In an effort to wrap my head around AngularJS directives I'm trying to build a custom HTML table out of an arbitrary JSON array of data passed to my custom directives; specifying a header and a ...
-1
votes
1answer
25 views
AngularJS: Trying to programatically add directives to a view
Here is my plunk: http://plnkr.co/edit/BGD0n6gmDM3kv5akIn4l?p=info
I am trying to make a view factory of sort. Ideally my controller will place a config object into scope that the view will use to ...
0
votes
3answers
38 views
angularJS: wait for template to be evaluated before directive loads
The Situation
Lets say I have a directive, that has to access certain elements via ID, inside the element on which the directive is defined. The problem, that can occur, is that by the time the ...
1
vote
0answers
19 views
AngularJs: transclude through include
I try to make the directive with dynamic template
app.directive('boolInput', function () {
'use strict';
var
restrict = 'E',
replace = true,
template = '<ng-include ...
0
votes
2answers
29 views
How to get all input fields within a form (AngularJS directive)
I would like to create a directive which does something awesome with all the input fields within a form.
However, i'd be happy if i could apply that directive only once (to the <form> itself) ...
0
votes
1answer
24 views
how to use directive in particular events in angular.js
I have a html like this ,
<div ng-controller="main">
<div ng-sparkline class="first"></div>
<div class="second"></div>
<div ...
0
votes
1answer
28 views
Angularjs ui for bootstrap
i'm using the Angularjs ui for bootstrap library. In particular im, wanting to customise the the behaviour of the "collapse" directive. Currently, if i have more than one collapsable section on a ...
0
votes
2answers
21 views
directive not properly being targeted by jQuery plugin
I've been playing around a bit with this slick jQuery datpicker and wanted to wrap it up as a directive that I could use inside my angular app. The code for the directive is very simple for right now:
...
0
votes
1answer
31 views
recompiling angular directive to add ng-module and ng-change programmatically
I want to know if I'm doing something right.
Preamble:
I have developed a Typeahead class that consumes a resource and stores the results within itself. The class has more or less the following ...
1
vote
1answer
28 views
how to defer a method execution in a directive in angularjs
I'm writing a directive which recives a function as a parameter, the directive executes and run whatever is contained into the function.
the use case is:
the directive contains a link
when the user ...
0
votes
0answers
20 views
How to correctly make nested directives work with jQuery Layout plugin and AngularJS?
I'm trying to incorporate jQuery Layout plugin into my AngularJS project.
I have a working version that I built only using jQuery, jQuery-UI and jQuery Layout plugin Here
Now I want to have the same ...
0
votes
1answer
18 views
Custom directive`s scope doesn't pass to child directive
Sorry if I duplicate existing post, but I search SO on the subject and couldn't find description for my case.
I got a custom directive (carousel) that contain inner directives (slides)
Carousel ...
1
vote
1answer
18 views
How to fix angular directives order (difference between Firefox and other browsers)?
I'm using angular-strap timepicker on one input field. I needed to add some actions on timepicker hide event, so following timepicker docs, I've created a directive which does that:
...
0
votes
0answers
28 views
Angular: Updating directive during request
I'm trying to make a loading bar, almost similar to the one on Google +.
When an action is running, I would like my progress bar to update itself, but it only updates at the start of the request and ...
0
votes
1answer
27 views
How to extract angular raw code from argument in directive and render it
Not sure, how to describe this question more. So there is simple code and jsfiddle
html
<div>
<span format="the value is: {{value||'no-val'}}" value="100" my-test></span>
...
0
votes
3answers
43 views
How to bind directive model to async service data
I'm trying to do simple thing - bind directive's model to service's data. And all right before service's data loads async (by $timeout or $http request), it simply does not update directive's model.
...
0
votes
1answer
26 views
angular directive (ng-class) inside custom directive
I just would like to show and hide an spinner every time that a user click on the link, in this case I'm using a promise to wrap the actual click method, when the promise get resolved I want hide the ...
0
votes
1answer
22 views
Is there any reason behind having two ways of doing ng-init?
I was trying out the angular js docs . I found this ng-init in http://docs.angularjs.org/api/ng.directive:ngInit
There it is said that there are two ways of doing ng-init .
ng-init="{expression}"
...
0
votes
1answer
22 views
How to re-apply a directive containing interpolation in AngularJS
Let's say you have a simple animation directive for slide-in:
directives.directive('slideIn', function () {
return {
compile:function (elm) {
$(elm).css('padding-left', ...
1
vote
2answers
44 views
angular: multiple directives asking for templates on
have the following html:
<div style="border:1px solid; height:300px; width:500px; position:relative; left:100px" id="canvas">
<tbox ng-repeat="tb in textBoxes" ...
2
votes
2answers
2k views
Uploading a file with AngularJS and bluimp on success callback of another form
I have followed the following tutorial in order to integrate the notorious bluimp jQuery file uploader in my AngularJS project.
After some research I found that in the options array, witihn the ...
0
votes
2answers
168 views
AngularJS UniformJS Select Control not updating
I'm building an application using AngularJS and UniformJS. I'd like to have a reset button on the view that would reset my select's to their default value. If I use uniform.js, it isn't working.
You ...
9
votes
3answers
3k views
Call an AngularJS Controller Function from a directive without isolated scope
I cannot seem to find a way to call a function on the parent scope from within a directive without using isolated scope. I know that if I use isolated scope I can just use "&" in the isolated to ...
1
vote
2answers
166 views
Adding ngModel to input with a directive
I have an input element and I would like to bind a ngModel and a ngClass to it using a custom directive, but I'm having some troubles.
What I have:
<input type="text" ...
2
votes
1answer
304 views
AngularJs - Directive events and dom rendering
In the code below, I am trying to use a template (with {{ value }} substitution) but I have been trying for two days to find a way of getting to the rendered code to set some properties on it.
I ...
15
votes
9answers
14k views
How do I implement the bootstrap navbar active class with Angular JS
If I have a navbar in bootstrap with the items
Home | About | Contact
How do I set the active class for each menu item when they are active? That is, how can I set class="active" when the angular ...
30
votes
4answers
17k views
How to set focus in AngularJS?
What is the 'Angular way' to set focus on input field in AngularJS?
More specific requirements:
When a Modal is opened, set focus on a predefined <input> inside this Modal.
Everytime ...
6
votes
2answers
3k views
Angular JS - How can i animate on model change?
i'm trying to do a nice fadeout+fadein transition when the currentVertical changes.
in knockout it was so simple but i can't figure it out here. please help.
the following code displays a UL list ...
1
vote
2answers
464 views
Angular Directive: Unable to bind to model properties
I'm using Angular to create a simple directive. I'd like to display the model properties x and y as attributes in the directive. However, instead of the values x and y in scope.textItems, I only get ...