Questions tagged as 'angularjs-directives'

1
answer

How to access a dynamic id through a directive?

Problem: I need within an angular directive, access a dynamically-mounted id inside an ng-repeat, and thereby manipulate the class of a specific item. In short, I'm using the accordion bootstrap example, and on my panel I have a ng-repeat tha...
asked by 11.02.2015 / 19:14
2
answers

AngularJS Directive - Good practice

I know that it is possible to create a directive in AngularJS in the following ways: <div angular></div> <div class="angular"></div> <angular></angular> <!-- directive: angular --> But what is the b...
asked by 29.06.2014 / 05:14
2
answers

$ window.location.reload ()

I use AngularJS in a webapp, in this webapp I have implanted a map where it shows my clients from a marker. The map I'm using is Leaflet ( link ) with a directive for AngularJS ( link ). My problem is this, when I first access the map, it wor...
asked by 16.01.2017 / 11:43
2
answers

Make two directives have the same $ scope in the Angular

I have a directive that generates a button, and when I click this button a counter increases by 1. This policy is inserted in two places in my index.html. I would like that when I clicked on any of the buttons, the two were changed ... Here i...
asked by 19.03.2015 / 14:12
1
answer

JSON array with checkbox AngularJS

I'm trying to form a JSON with what is selected by checkbox , but when I select it it inserts, but when I try to get check , it reinserts. The correct would work this way , but forming a array of JSON and not just words or numbers....
asked by 10.12.2015 / 19:36
3
answers

Declaration of Controller AngularJS

Following the script below generated a doubt on which statement to use, in the AngularJS documentation I found the two forms in different examples, but I did not find an explanation of which statement is used or if there is any specific case to...
asked by 07.04.2015 / 15:53
2
answers

Is there a way to not populate HTML with policies?

Using the ng-click directive to get a click event on a link would look something like: <a ng-click="call('home')" href="#" title="ir para homepage">Home</a> But would not this be the same as using onclick="call('home...
asked by 26.11.2014 / 21:49
1
answer

How to select a value from an option by AngularJS

Well, I make an interaction to get the options, and I want the first option to be selected <select class="form-control" name="accounts" ng-model="vm.deposit.account"...
asked by 25.05.2015 / 20:04
2
answers

Doubt with ng-if or ng-hide AngularJS

I'm trying to use the ng-if directive to hide a button as soon as I click another but I could not find any examples and found the documentation unclear, could anyone give me an example ?? using this button case, when I click on a button I...
asked by 13.01.2015 / 13:56
2
answers

Focus on the next input when reaching the maximum number of characters

I created a directive to move the cursor to the next field when it reaches the maximum size of characters, as follows: var app = angular.module("myApp", []); app.directive("moverProximoCampo", function() { return { restric...
asked by 25.06.2018 / 21:53