Tagged Questions
0
votes
4answers
21 views
nested ng-repeat $parent.$index and $index
I have a strange bug that, unfortunately, I cannot replicate with jsfiddle. I've commented out my entire code (Except libraries,etc) except for the following snippets. Is there something obvious ...
0
votes
1answer
10 views
Generate new $index for array items per specific key:value in Angular
Please be patient if I don't understand something and need clarification as I'm still new to Angular, and please simplify explanations for an Angular newbie if you can, thanks!
I am working on a ...
0
votes
2answers
28 views
AngularJS - ng-repeat show one item at a time
looking for some ideas here. i have a meal plan object that contains an array of meals. only one meal can be set as primary at a time but i want the user to be able to cycle through the array of meals ...
-1
votes
1answer
18 views
Angular keep iteraction object in option with ng-repeat
With ng-options the selectedCar will be a car object
<select
ng-model="selectedCar"
ng-options="car as car.description for car in cars track by car.id">
</select>
With ...
1
vote
1answer
29 views
Display keys and values with Angular array
I have an array in Angular like this:
$scope.test = [
{'item1' : 'answer1' },
{'item2' : 'answer2' },
{'item3' : 'answer3' }
];
And so on...
Now there's 2 things I want to do. Firstly I want ...
0
votes
0answers
16 views
AngularJS - Filter HTML character references
I have a set of JSON responses/results that i display to the front-end.
Some of these contain HTML character codes, for example:
<b>Some Text</b>
Rather thank using ngSanitize, can i ...
0
votes
1answer
20 views
Preserve scope values while moving template in ng-repeat
I have two collections binded to ui that populate through ng-repeat
In that I have included ng-include="template.html"
<div>
<div ng-repeat="item in items1">
<ng-include ...
1
vote
2answers
33 views
How can I change ng-click behavior for a single element in an ng-repeat?
I am refactoring a table written in angular. Currently ng-repeat is used to create multiple tables rows, any of which will redirect to a given ui-sref when clicked upon:
<tbody>
...
0
votes
2answers
25 views
AngularJS: scope change in ngClick gets lost
I have ngClick and ngClass on an element duplicated by ngRepeat:
<li
ng-class="{'active': $parent.mem.A == $key, 'not-active': $parent.mem.A && $parent.mem.A != $key}"
...
0
votes
1answer
37 views
Angular JS Use modal in ng-repeat list
I am displaying a list using AngularJS's ng-repeat... Below is the template per list item; It all works except for the {{...}} that are used inside bootstraps modal. It 'almost' works the way it ...
-1
votes
1answer
37 views
ng-repeat with as alias not working
According to documentation this directive should work: user in users | filter:search as searchResults. But it does only if I remove as, but I need it to show empty results message. Here is a jsfiddle ...
2
votes
2answers
18 views
How to apply filter for 2 dimensional json object with ng-repeat?
This is my json:
[{"node":
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.',
'age': 1}},
{"node":{'name': 'Motorola XOOM™ with Wi-Fi',
'snippet': 'The Next, ...
1
vote
1answer
33 views
Quiz questions with Angularjs
I create quiz app with angularjs and have some issues.
When I click "next" checked radio doesn`t reset
<div ng-repeat="answ in quiz.typical">
<label ng-click="quiz.checkAnsw()">
...
0
votes
1answer
104 views
Filter array object based on one of its properties in angularjs ng-repeat
I am using angularjs v 1.2.
My HTML code:
<div ng-repeat="activity in currentActivitiesList" >
<h3 style="color: green;" ...
1
vote
2answers
17 views
ng-repeat doesn't repeat after changing the value
At first i get the data in the begining but after posting some new students i want the array to update and it updates but table doesn't and i dont know why .It suppose to be like this or what?
This ...
1
vote
1answer
26 views
angularJs filter nested object Track by
I created a custom filter, but its giving me an error
I created a fiddle here:
fidddler
I have this user data:
data: [{
profile: {
firstName: 'John',
...
0
votes
2answers
27 views
AngularJS nested ng-repeat access to Index
I have nested array so I had to use 3 times ng-repeat
<div ng-repeat = "cat in cats" >
<div ng-repeat = "kitty in cat " >
<button ...
0
votes
0answers
13 views
Adding nested ng-form's within a table using ng-repeat
I'm building a dynamic table with ng-repeat where each row is a record in my database. Some of these fields are allowed to be editable and I find out which ones are through my ...
0
votes
1answer
82 views
ng-repeat specify once json formatting
In HTML:
<div class="field" ng-repeat="field in fields ">
<strong>{{field.fieldName | json}}: {{field.itemCount | json}}</strong>
<p ng-switch="field.type">
<p ...
1
vote
3answers
34 views
AngularJS ng-include scope
I am experienced as a developer but a beginner in angularjs and I have not used javascript for a while.
My site is separated into several angularjs apps. But two apps could have to display the same ...
0
votes
1answer
22 views
Angularjs filter on nested property
I have an array of the following json object:
{
fooBar:{
Id: 2
Foo: {
Id: 4
IsNew: false
}
Bar: {
Id: ...
-1
votes
0answers
18 views
Kendo UI Grid Error messages not appearing in UI-Bootstrapper Alert ng-Repeat
I am trying to handle Kendo UI errors gracefully by displaying a UI-Bootstrap Alert with the error message in it.
View - Index.html
<alert ng-repeat="alert in alerts" type="{{alert.type}}" ...
0
votes
1answer
22 views
AngularJS form validation (using $invalid with ng-reapeat and Bootstrap)
I am trying to validate my AngularJS form, adding has-error class to form-group like:
<div class="form-group" ng-class="{ 'has-error': form.field.$invalid }">
<input type="number" ...
0
votes
2answers
31 views
AngularJS creating dummy directive
I want to create in AngularJS a "dummy" element to make nested ng-repeats.
So that following
data.test = [{h:1, d:[11,12]}, {h:2, d:[21,22]}];
----------------------
<dummy ng-repeat="a in ...
1
vote
3answers
24 views
Angular not selecting radio button from model
I'm working on system where I have an ng-repeat populating from an array of elements, with a radio buttons setting a property. When it loads in, none of the radio buttons are selected, but when I ...
0
votes
1answer
30 views
angularjs ng-repeat filter on static value not working
I can't figure out why the code below is not filtering just the values with unique_id of "027". I've tried it as a string as well '027'...
JSON file:
[
{
"unique_id":"027",
"title":"How ...
0
votes
2answers
40 views
How to refresh table data after insert or update?
My table data is not updated after I insert a new record.
Index view
<div class="row">
<div class="large-12 columns">
<table class="large-12">
<thead>
...
0
votes
2answers
49 views
angularjs ng-repeat after render
I am using AngularJS with ng-repeat directive.
I really need to know if there is a way to bind events like 'ng-repeat-before-render' and 'ng-repeat-after-render'. I need that for several reasons, one ...
0
votes
5answers
39 views
AngularJS - Filter empty objects
I have a $scope.myData object that contain a chunk of data. What i am trying to do is display the data but filter out the nulls and empty strings:
$scope.myData = [
{
"ID" : "001",
...
0
votes
0answers
49 views
ng-repeat using scope function return value not calling function
I'm having a bit of a trouble using the return value of a function as the array to iterate over in ng-repeat in a custom directive.
The code is rather simple:
.directive('treeRow', [function () {
...
0
votes
0answers
35 views
Add content to transcluded content in angular directive
I'm trying to add content to the transcluded html inside my directive. While it works visually, the console is giving me an error and I don't know how to fix it.
Here's a plunkr showing the issue: ...
-1
votes
2answers
25 views
Get index of row in table using angularJS
I want to get index of each row in this table using angularJS
<table>
<tbody>
<tr ng-repeat = "cust in costomers">
<td> cust.name </td>
<td> cust.phone ...
0
votes
1answer
36 views
Access ng-repeat $index inside directive link function to access item in collection
I've run into a wall and none of the documentation is helping thus far. I'm trying to create a directive that replaces an element with an iframe pointed to an external resource and each item in my ...
0
votes
3answers
42 views
“Duplicates in a repeater are not allowed” on ng-repeat
I've got the following json data returned from a service request:
{
"entries": [{
"id": 2081,
"name": "BM",
"niceName": "bodmas"
}]
}, {
"id": 8029,
...
1
vote
2answers
52 views
Angular Js : How to find first and last element in ng-repeat and add special class to them?
I changed to following using angular js
<section id="social">
<h2 class="line">Social Profiles</h2>
<a href="#" class="first"><i ...
0
votes
1answer
41 views
AngularJS make ng-repeat generic
I want to make one directive using ng-repeat, where I have two use cases. In one use case, I want to print the object for each repeat (person). In the other, I want to print a property of the person ...
0
votes
2answers
31 views
Increment iterator when repeating key value in angular?
Basically I just want each row of the table to hold the current key value, and the next. Is there a way to increment from inside the loop?
<tr ng-repeat="(key, value) in object">
...
2
votes
3answers
43 views
Angular JS Date format inside Ng-Repeat
Actual Date coming from JSON
Need to format it as below .
Effective Date : 2010-08-31 (trim the time stamp)
End Date : 2010-08-31 (trim the time stamp)
Am using the below code for Formatting the ...
1
vote
0answers
50 views
Please explain why angular ng-repeater decrease render performance as the number of rows increases
I have been observing the decrease in render performance of angular ng-repeater as number of rows increases
Here is my experiment. http://jsbin.com/quyofifa/1/edit?html,js,console,output
When you ...
0
votes
3answers
23 views
AngularJS - dynamic naming using $index in expression
I have a directive in which i create many ng-form's and i name each form based on the $index (from the ng-repeat). My problem is that i want to show an error container (that contains the error ...
0
votes
1answer
46 views
AngularJS ng-repeat not updating after database insert
I'm new to AngularJS. I have been stuck on this all night. I have a form and I want the table to add the new row once I click SUBMIT. The form works fine and adds the document to mongodb but I can not ...
0
votes
0answers
14 views
ng-repeat do not evaluate from $sce.trustAsHtml inside directive
I have a directive that has a piece of custom HTML that I can pass in as a custom option. I would like to use ng-repeat inside the custom HTML, but it is not being displayed. Here is the code.
var ...
1
vote
3answers
17 views
Why does the ng-repeat directive create a child scope?
Question: Why does the ng-repeat directive create a child scope?
I don't understand why this is the case. Creating a new scope makes sense to an extent if you explicitly create a child controller, ...
1
vote
1answer
37 views
angularjs how to access ng-repeat filtered value outside its scope
I have a json defined in my scope like
$scope.People = [
{
"firstName":"John",
"lastName":"Doe",
"Choices":[
{
...
0
votes
0answers
17 views
Angular JS $http service within a directive
I am trying to create a implementation of the Facebook popover for my application.I have come across a directive for creating dynamic popovers.I want my application users to be able to hover over ...
0
votes
2answers
35 views
Angular ng-repeat filter on subarray
Using Angular, I'm trying to filter using ng-repeat on FactorName given the following schema.
Filtering using
<... ng-model="query.Factors.FactorName" ...> doesn't work (not surprisingly).
I ...
1
vote
3answers
33 views
How to validate the radio button inside ng-repeat?
I have the below code for student's assignment status marking. My problem is it is not necessary that all students should be marked. The user might mark some might not. Now how to validate that at ...
0
votes
1answer
25 views
AngularJS - Displaying Date Data For Items Only In The Last Five Years
I have a $scope.myData object that contains a list of addresses and dates that i've own/rented, eg:
Example of my data
From Date 2011 To Date current
From Date 2010 To Date 2011
From Date 2009 To ...
0
votes
1answer
40 views
ng-repeat execute many times
I have a little demo on jsfiddle :
HTML:
<input type="checkbox" id="chkUsr{{usr.Id}}" ng-model="usr.Checked">
{{usr.Name}} : {{usr.Checked}}
<input type="text" ng-model="research"/>
...
0
votes
2answers
31 views
AngularJS Dynamic Filter Configuration fail to resolve
I'm a newbie to AngularJS with some fair knowledge with KnockoutJS also.
I'm trying to implement a search feature on 'products' in my ViewModel that is configurable by the end user by combining..
...