Tagged Questions
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 ...
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
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
26 views
How to get a callback when element will be completely builded
I have custom directive which moves DOM element on every ngShow which returns true. This directive requires dimensions of dom element.
HTML
<div class="span5 search-results__mentions-block" ...
3
votes
2answers
69 views
ng-repeat not loading data after html has been compiled
I have a directive that copies a bit of html that includes a controller and an ng-repeat. I compile the html and stick it into the dom. I can see that the new html is picking up the scope of the ...
0
votes
1answer
24 views
angularJS: Why does binding to scope inside a directive result in lost content of ng-repeat?
I have this fairly simple HTML structure:
<div ng-controller="MyCtrl">
<div dir1="xy"><div>dir1static</div><div ng-repeat="item in ...
0
votes
0answers
29 views
Angularjs and bindonce - Is this a proper way of using bindonce and how to check that it is working correctly?
So here is my question:
I have the following:
<li bindonce ng-repeat="value in Types" ng-include="'views/repeaters/types.html'"></li>
and I was wondering if this is the correct way to ...
0
votes
0answers
32 views
Paginated slides in Angular
I have an array of items which I want to filter on different kinds of filters. Because I have more than 2000 items I want to paginate between pages so I've created a startFrom directive and used ...
0
votes
0answers
29 views
what are $$hashkey objects in Angularjs? How can I read multiple file inputs?
I am trying to get multiple file attachments from file inputs using the following directive:
var app = angular.module('app',['ui.bootstrap']).config(function($interpolateProvider){
...
0
votes
1answer
47 views
AngularJS directives with HTML5 drag and drop — issue with scope object
I'm fairly new to angular and I'm having a hard time wrapping my head around where the items are being pushed to. I am not sure if I am correctly setting up the functions to be used with drag/drop and ...
0
votes
2answers
64 views
How to use ng-repeat in directive with isolate scope?
I'm trying to use ng-repeat in a directive that has an isolate scope, but I can't seem to get it working.
When I add an isolate scope to my directive, ng-repeat seems to not be able to see items, ...
0
votes
0answers
41 views
Angularjs ng-repeat orderby error in custom directive
I have a directive that creates a list, I'm trying to get the column sorting to work, so I created another directive for sorting the columns.
I get this error in the console while I'm trying to ...
2
votes
2answers
82 views
ng-repeat's compile and link functions
I'm trying to understand the difference between compile and link function. In the angular documentation for the compiler it says
Some directives such as ng-repeat clone DOM elements once for each ...
0
votes
1answer
82 views
AngularJS - ngRepeat. Need to keep focus on the same element event after ng-repeat re rendering
I have a list of three inputs, each of them can be deleted by the user by pressing a red cross placed at the left side of them. When the user delete one input, the next one is focused and the selected ...
0
votes
1answer
77 views
AngularJS Directive for decimal numbers between 0 and 1
I want a directive in AngularJS which should allow decimal numbers between 0 and 1. In addition, it can allow "-1" as well.
For eg:
-1 is valid
0 is valid
1 is valid
0.12 is valid
0.99 is valid
...
0
votes
1answer
99 views
LocalStorage with directive in AngularJS
I use ngStorage (https://github.com/gsklee/ngStorage) for storing some data in the localStorage of the browser.
I have this markup
<ul class="cards">
<li ng-repeat="card in cards">
...
0
votes
0answers
75 views
Integration of Angular and JQuery.iCheck by using a directive is not working
I'm trying to integrate JQuery.iCheck (plugin for checkbox&Radio buttons styling).
I followed few suggestions here that said the the way to integrate a jQuery plugins to be fully compatible with ...
0
votes
2answers
52 views
What is `priority` of ng-repeat directive can you change it?
Angular Documentation says: -
The compilation of the DOM is performed by the call to the $compile() method. The method
traverses the DOM and matches the directives. If a match is found it is added to ...
1
vote
2answers
94 views
{{$index}} of ng-repeat computed after linker function of angular directive. $compile it?
html
<div repeater ng-repeat='item in items' class='first' id = '{{$index}}' > {{item}} </div>
angularjs directive:-
angular.module('time', [])
.directive('repeater', function() {
...
0
votes
0answers
26 views
Problems with scope: ng-repeated and filtered custom directives
I have an array of objects that each contain a url, a title, and a description of page content, and I built a little directive to display the information.
On initial glance, my directive works fine. ...
0
votes
2answers
105 views
Transcluding a child directive into a parent directive
I'm a newbie to Angular and have been trying small samples to learn the code.
Firstly, I would like to thank the brilliant solutions posted in stackoverflow.com.
Saved me so many hours so many times ...
0
votes
1answer
92 views
Injecting a HTML template to DOM on click the clean way (Create an instance of a class)?
In my AngularJS project I have something like this (it's a dropdown menu with customer names. With a click on one of the names a Scrum Card should appear with the customer's names inserted in the ...
0
votes
2answers
138 views
AngularJs radio buttons are connected when using ng-form in ng-repeat
See this plnkr http://plnkr.co/edit/WZHMuYY3y2wbI6UysvY6?p=preview
When using a ng-form tag on an ng-repeat which contains a radio button group, the radio buttons are linked so if you check a radio ...
0
votes
1answer
108 views
ng-repeat, directive and on-click. How do they combine?
I want to trap on-click event of button. The id of button is dynamically generated inside the ng-repeat.
.set(ng-repeat='button in ['4', '3' , '2', '1' ]')
button(id='{{$index}}') button ...
1
vote
1answer
333 views
Angularjs dom load ready
I am working on angularjs. I created a scrlipt. When I started applciation on browser, appearing like this,
and a little later coming result,
<body>
<div ...
0
votes
2answers
203 views
Using ng-repeat to repeat the same div with different id and ng-init
How would I use ng-repeat to repeat multiple divs with this structure (where neighborhood will be different for every div, but the rest will be the same)?
<div id="neighborhood" ...
1
vote
1answer
71 views
angularjs : select with different (key, value) not working properly
I am trying to load angular "select" with the following code
<select class="span11" ng-model="user.countryOfResidence" ng-options="c.option as c.value for c in countries" required>
Its loads ...
0
votes
1answer
84 views
Angular ng-repeat and jQuery plugin
I'm trying to turn this jQuery plugin into an Angular directive. I did the following:
define(['directives/directives'], function(directives){
directives.directive('vivifysortable', ['$rootScope', ...
0
votes
1answer
100 views
Angularjs : how to use key of object to retrieve value of another json object
i have an array of json objects
$scope.arrary = [{"a":"value"},{"b":"value2"},{"c":"value3"}];
$scope.secondObje = {"a":"this is updated value","b":"this is new value"}
i can iterate through ...
0
votes
0answers
25 views
How to use binding in directive?
In my ng-repeat I have a directive called update which takes the current index of repeat. How can I pass index value to my directive ?
This is how my markup looks like:
<ul>
<li ...
1
vote
1answer
106 views
How to update $scope.items array order in response to user re-sorting the DOM array using Angular-UI ui-sortable directive
I am using ui-sortable directive (from angular-ui ) in the view
<ul ui-sortable>
<li ng-repeat="item in items" >
{{item.property1}}
{{item.property2}}
</li>
...
0
votes
1answer
179 views
AngularJS dynamic table with multiple headers based on hierarchical collections
I'm trying to create a table with two rows for header, based on a hierarchical collection. I've found that ng-repeat can't do that, and I'm trying to make the job with a directive and Angular.forEach.
...
1
vote
1answer
51 views
“Deep” angular application vs. “wide” angular application? AKA many components/directives vs. many controllers
Which is better: to split up an application into many different directives/components or into many different controllers?
Splitting up the application into many different directives/components ...
2
votes
3answers
919 views
AngularJS directive inside ng-repeat is not playing nice
I'm trying to re-use a portion of my HTML view in multiple places. The portion I want to re-use is table cells in an HTML table. The problem is that my custom directive inside a ng-repeat is doing ...
2
votes
1answer
175 views
Angular Directive table rows issue
I am a beginner Angular programmer, but I am really close to understanding the directives.
I create a fiddle here, but I have never used fiddle before, and it is not quite rendering ...
the tr-row ...
0
votes
1answer
157 views
AngularJS Directive with no Template and Sharing the updates from parent scope
I have a very simple requirement where a directive is placed inside a ng-repeat in this I wanted to push down the changes to directive so it updates the UI. Meaning I want the value of Contact(not ...
0
votes
2answers
165 views
trying to use angular-ui-bootstrap radiobutton directive with ng-repeat in an angular project
So... I'm trying to generate a radiobutton group using ng-repeat:
<div class="btn-group yb-radiobuttons">
<button type="button" class="btn" ng-model="radioModel" btn-radio="'all'">All ...
0
votes
1answer
97 views
Angularjs : adding ng-repeat in a directive
i am new to angularjs and trying to write a directive. My code for directive is
Directives.directive("roleTemplate", function(){
return {
restrict : 'EA',
template : '<div ...
0
votes
2answers
111 views
ng-repeat wont work in directive template
I am trying to use ng-repeat in directive template like this:
JS
var module = angular.module("myModule", []);
module.directive('direct', function ()
{
return {
restrict: 'E',
...
1
vote
1answer
66 views
AngularJS directive
I am adding the following div multiple times on a page.
<div class="box span6">
<div class="box-header">
<h2 class="custom"><i class="fa-icon-group" ...
0
votes
2answers
164 views
AngularJS – append row after element in directive
My question is similar as this one, but instead of prepending row, I want it to append.
This doesn’t work:
app.directive('createTable', function ($compile) {
return {
link: function (scope, ...
0
votes
2answers
160 views
Angularjs - Accessing shared service data from an ng-repeated directive
I'm trying to create drag-drop directives using Angularjs. Draggables in this scenario are generated by an ng-repeat directive, walking over an array. Code at http://jsbin.com/ECAWuDE/1/edit works as ...
2
votes
1answer
303 views
directive not working inside <tr> that is ng-repeat bound
I have a table where the rows are repeated via ng-repeat.
I am trying to crete a template that generates columns for each row
<table>
<tr ng-repeat="p in positions">
<customtd ...
0
votes
1answer
133 views
Directives, Services & ng-repeat
I'm building a complex, variable layout with infinite scroll UI in AngularJS.
Think something like Flipboard with a load of repeating data items, each item containing the same thing (title, ...
0
votes
0answers
63 views
Angularjs with JQuery Shapeshift plugin issue
I am using shapeshift jquery plugin to show items to allow the user to re arrange the items as they wish. I am listening on drop event to persist the reordering info to the backend and updating scope ...
0
votes
2answers
195 views
Angularjs ng-repeat shows n items n times
I'm attempting to use ng-repeat in a couple of elements on my page.
For some reason it's showing each of the n elements n times and I cannot figure out why.
My array looks something like this:
...
1
vote
1answer
47 views
how to add logic in my ng-src angularjs
I need to add logic as witch image to show
here is some code i think it would work:
view:
<img ng-src="{{checkImage(data.image)}}" />
js
function checkImage(img){
if(img==1){
return ...
0
votes
2answers
323 views
Angular JS - Inplace Edit inside tree
I could not get inplace edit working within a tree.
I forked a fiddle where inplace edit worked within a simple array of input data
Here is the fiddle
http://jsfiddle.net/cguy/wcMzw/8/
thanks for ...
0
votes
2answers
370 views
Calling order of link function in nested and repeated angularjs directives
I'm fairly new to Javascript programming and I have only touched upon AngularJS. In order to evaluate it I decided to write a simple note application. The model is really simple, a list of notes where ...
0
votes
0answers
98 views
Using ng-repeat and ng-class in directive template causes an unknown error
I have a directive that turns a collection of items into a variable number of columns. The template for the directive uses ng-repeat to repeat the columns, and ng-class to apply a css class that turns ...