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
14 views
issues performing two-way binding in directive template with parser and formatter in AngularJS
I'm having trouble figuring out how to create a two-way binding with an element inside a template for a directive in AngularJS.
My example:
HTML
<div ng-app="App">
<div ...
0
votes
0answers
22 views
Custom ngRepeat
I'm trying to create a custom AngularJS repeat directive, because ngRepeat doesn't fit my needs in this particular case, where I'm creating a sort of templating language based on angular directives, ...
0
votes
1answer
36 views
How to implement jQuery range slider in AngularJS
I am trying to use anuglar-slider in my existing AngularJS app.
I followed the author's comments here
I downloaded below files (in Head tag) from author's github and added in my index.html
HTML ...
0
votes
0answers
20 views
How would I test a $scope.watch (AngularJS) change in Jasmine?
I've just recently started writing something with AngularJS and I'm not sure how to go about writing a test for this particular thing. I'm building a "Help Request" mode that has different states. So ...
1
vote
2answers
34 views
AngularJS - Access isolated scope in directive's link function
I'm giving a first try at AngularJS custom directives.
I'm having trouble using (or understanding ...) the isolated scope in the link function of the directive.
Here is the code of this part of my ...
1
vote
1answer
32 views
Different transitions with AngularJS
How can I enable different transitions with AngularJS. Lets Say, I have a sidebar in my web application. I the user clicks a button X, the sidebar should disappear very fast, if the user clicks ...
2
votes
1answer
21 views
How to eval an attribute containing {{}}
In the following directive I'd like to eval {{selectedForApproval.length}}. This worked when it wasn't a directive, but once I put that into a directive, I'm unsure how to process the binding.
HTML: ...
0
votes
1answer
33 views
Why is scope.$watch not triggered when a value is set via $parse assign in Angular?
I have two directives. One directive show a dropdown and the other directive must hide the dropdown when somewhere else on the page is clicked.
dropdown directive:
app.directive('dropdown', function ...
2
votes
1answer
34 views
Extending directives in AngularJS (sharing properties before and after link)
I have a directive which creates a rich text editor in its LinkingFunction. The small directive I'm using for my rich text editor can be found at ...
0
votes
0answers
31 views
angular.js: How can I automatically add labels to input fields?
I'm working on a bigger project with angular.js. Therefore, I want to make the work for a single form as easy as possible. As we're also using bootstrap, the code for a single input field in a form is ...
0
votes
1answer
15 views
Bind ng-click function in compile with AngularJS
When we try to add an ng-click function (linked to a controller action) onto an element during the compile phase, it is not working.
We can get it working if it is in the link function, but as we ...
0
votes
2answers
36 views
How to set the value of an attribute in Angular?
In my directive I have this code:
// hide all drodowns with this attribute
$(document).find('[dropdown]').each(function (index) {
if ($(this).is(':visible')) {
var a = ...
0
votes
3answers
47 views
Make another field invalid while validating
I'm dealing with a standard "change your password" form where you have two fields: password1 and password2. Those two fields are just to validate that the user enter the right password and they need ...
3
votes
0answers
63 views
AngularJS directive controller manipulating the DOM
The Developer's Guide says, controller specified inside a directive is instantiated before the pre-link function and also that it is NOT safe to do DOM manipulation in the pre-link function.
Then why ...
0
votes
1answer
37 views
replace element in angularjs directive linking function
I'm creating a <row> AngularJS directive that needs to replace itself (the <row> tag must not be present in the DOM after execution) with a dynamic template that can contain any HTML code.
...