1
vote
4answers
40 views

AngularJS : Ng-Options in Array of Arrays inside select

I am trying show options from array of array inside a select drop down but it is not showing up. Can someone tell me what I am doing wrong here ? https://plnkr.co/edit/HMYbTNzkqkbAGP7PLWWB?p=preview ...
0
votes
2answers
53 views

I need to add an object to an array using angularJS

I'm new to angularJS and currently struggling to add an object from a form to an array. When I click the "Add New Product" it triggers the "newItemModal", I enter the new product information but ...
1
vote
2answers
42 views

How to merge two different object from JSON data

Hi I need some help with this code snippet. The output that I get is multiple different objects of JSON data. But I want to extract the destination data then merge them as an array. But all the data I ...
0
votes
2answers
37 views

How can I iterate over multiple maps (key,value) using ng-repeat in AngularJS

In my controller, I have data like this: "type": [ { "aMap": {"5.0": 0}, "bMap": {"10.0": 0}, "cMap": {"15.0": 0}, "dMap": {"20.0": 0}, "...
-4
votes
0answers
65 views

Clear an array with angularJS

i recently bought an HTML template using AngularJS. This is a shop where you can add items on your cart, and i'd like to be able to make a function that empty the cart. When i run this command in ...
1
vote
1answer
31 views

Simple sum ng-repeat column

I have a page that returns a list from an ng-repeat. All I need to do is add up the numbers that are returned. I know there is a simple solution. However, I cannot find the correct implementation. ...
0
votes
2answers
35 views

How to split two items inside a JSON array in angular

This is my code: $scope.center_name = []; $scope.stats = ["Stats"]; $scope.totMemCenterData = []; var query = "SELECT count(*) as tot_mem, centers.name as center_name FROM ...
0
votes
2answers
28 views

ng-options first position value second position key

I have an array which I want to iterate using ng-options that looks like this array[array[2],array[2],array[2],array[2],array[2]] The first position is the username and the second position is code ...
0
votes
0answers
22 views

Undefined Object is getting pushed in the array while using ng-repeat in angular

I am trying to push newComment(from DishCommentController) in the array of comments(to DishDetailController). Data is getting logged into the 'newComment' but after pushing it into the 'dish' array it ...
0
votes
1answer
48 views

angularjs : ng-if condition showing if condition fails on ngrepeat?

Used ng-if for ng-repeat with array and non array. It works fine (show the div) for arrays and non-arrays if the condition is true, however it still displays the div if the condition is false. I ...
1
vote
1answer
31 views

Cannot read property 'comments' of undefined error in angularjs

I asked this question before too. Maybe someone can caught the error here. .controller('DishDetailController', ['$scope', function($scope) { var dish={ name:'Uthapizza', image: '...
1
vote
1answer
74 views

Group array with groupBy

I am grouping my array using this function: Array.prototype.groupBy = function(prop) { return this.reduce(function(groups, item) { var val = item[prop]; groups[val] =...
1
vote
1answer
67 views

error when pushing new element to array in javascript

I am trying to add comments from html form elements to array in angularjs. When I use javascipt push function I got an error "property of object doesn't exist". Can someone help me to solve this ...
0
votes
1answer
25 views

convert number into array element and undefined into empty array

In this Plunker example the following filter is used to make select box options selectable only once http://plnkr.co/edit/BBqnTlxobUpiYxfhyJuj?p=preview .filter('arrayDiff', function() { return ...
0
votes
2answers
52 views

JSON Object is not resolved before Controller is instantiated

I'm using Ionic to create an app, and in the controller, I'm getting an object that's resolved from the app.js. This object has several properties including an array like so: { "objectId":"id", ...
0
votes
2answers
34 views

How to get dynamic array value using check box in angular.Js?

I am trying to get value of check box using angular =. I have java object at HTML page. As user checked individual box so singe value should be in my array, if user check select all so all box should ...
1
vote
2answers
33 views

Angular custom filter that returns if the array has the matching string

I've been scratching my head for awhile to get this right. I feel like I am almost there but can't get the last piece right to make it work. Here's what I am trying to do. I am creating a custom ...
0
votes
1answer
25 views

How to make object (li element in ng-repeat) move DOWN on click - angularJS [closed]

i have problem to make a function on click event when is checkbox selected (equal=true). when user select checkbox and click on buttonDOWN i want that element move down (DOM MANIPULATION) i already ...
1
vote
2answers
53 views

JSON & angularjs. Filter an array by ID (and not by index)

How can i filter this JSON by an element (in this case the id) without using the index? ABC: [{ ID: home, elementsHome: [ { el1: x, el2: y}, { el3: d, ...
0
votes
2answers
31 views

ng-model not working propertly with ng-options and array

After changing from ng-repeat in select options to ng-options i came across some problems. The issue is that ng-model sends whole array instead of the selected one. I have an array with few values ...
1
vote
4answers
31 views

Getting dynamic data from Json to Html with Angularjs

var app = angular.module('myApp', ['ridge-speedometer']); app.controller('customersCtrl', function($scope, $http, $timeout) { $scope.getData = function(){ $http.get('asd.php').then(function (...
2
votes
4answers
37 views

How to convert key-value pairs to list of array using `AngularJS`?

This is our data: $scope.arr = { "1": "A", "2": "B", "3": "C", "4": "D", "5": "E", "6": "F", "7": "Others", "fromDate": { "$date": "2015-02-13T20:59:28....
2
votes
2answers
42 views

Angular - Simple custom service not returning data back to controller

Been scratching my head for weeks on this particular part of my code. What I have is a simple custom service that would fetch my data via ajax, I then perform a post process and lastly I want to ...
0
votes
2answers
23 views

Display array result in marquee tag like news ticker

I am trying to display result of my ajax query in marquee tag like news ticker. Unfortunately i am not able to display content inside the array. JavaScript Code: success: function (...
2
votes
1answer
41 views

how can i make this filter with ng-repeat

i coding a social media aplication. I have a problem with profile menu in profile page. I want it to be visible menu items depending on certain circumstancesces. I did put menu items in a array like ...
0
votes
1answer
42 views

How can I get results of arrays in many Objects in Angular or Javascript?

I need a help in this question: I have objects with arrays. I need get the values in the arrays to send to the server. My question in Image: This is the code I print in the console: var cart = ...
2
votes
1answer
36 views

Two arrays with objects to become new array with same lenght, but all data from original arrays [duplicate]

I have two arrays with an equal amount of objects in them. I want to take each array's first object and put them together in a new array as the first object in the array. I then would like to keep ...
1
vote
2answers
49 views

Return single record from object array

I have an obj that I am returning from a db query, which looks like this. I want to be able to display a singe record from the "contacts" array, but I'm now sure of the best way to do this. Here is ...
-3
votes
2answers
47 views

Proper array structure [closed]

Commonly, arrays are formed like var array = ["some","string","elements"] or var array = [1, 2, 3]. Been searching for times, but I haven't seen articles that may clear my mind. Now, is it possible to ...
0
votes
1answer
24 views

AngularJS $.map: RangeError: Maximum call stack size exceeded

Function.map throwing console error while performing $.map function. where result.extraIds includes 300k records. $scope.extraIds = $.map(result.extraIds, function (item) { return item.id; })...
0
votes
1answer
40 views

group and sum json object javascript

I would like to group json object by "topic_id" and sum "score" of each "topic_id". I have json object like this { "topic_id": { "0": 1, "1": 1, "6": 2, "8": 2, "12": 3, "13": 3, ...
0
votes
1answer
14 views

JQuery with 2D array in ng-repeat

I need to get the value of the 2D array on this code using ng-repeat. <div ng-repeat="n in status"> <div ng-repeat="x in n track by $index"> ...
0
votes
1answer
52 views

AngularJS add row in table

I use angularJS and I have one table on my page, I made one button to add row with input fields. My solution work good for adding rows and value of input fields in form, but doesn't work well where I ...
-2
votes
1answer
38 views

How to get the value of a key in object inside an array [closed]

I have an array of objects. With some logic I am returning the id of some selected objects. What I need is to get the value of name property of that selected objects. I have only one thing to process ...
1
vote
0answers
27 views

Using ng-model on a dictionary value within an array

So I have an array that I've populated like so: tempArray[tempProductName] = null; tempArray[tempAttributeName] = response.data[0].Attributes[k].Name; tempArray[tempAttributeValue] = null $scope....
1
vote
1answer
28 views

JS league table complex sort head 2 head

This, as far as i can search stack overflow answers, is not the 'normal' league table sorting issue. I have a league table im working with in javascript (angular 2), which i can sort as needed by ...
0
votes
0answers
7 views

How to add markers to Array of coordinates in ionic2?

I want to show different markers for different values on specific coords on Google maps. I got an array Coords that contains Lat, lon and a value. this.Coords = [ {lat: '50.91187', lon: '...
1
vote
1answer
20 views

Angularjs - How to show nested array on click of Parent array in ng-repeat

Please refer to this plunkr, plunkr WHat I want is If I click of Reading Korean then it should display its nested part i.e. Vowels,Consonants,Simple Words,Harder Words angular.module('...
2
votes
3answers
32 views

AngularJS filter object array with search term in JavaScript

I´m currentrly trying to filter an array of objects with an search term from an input field. I know there is a way to apply a search term to an ng-repeat directive using this code ng-repeat="item in ...
0
votes
3answers
60 views

Check if obj exist and push to array

I want to iterate through a JSON response, check to see if key,value exists and if not, add it to the array. $scope.InitProdToArray = function (data) { angular.forEach($scope.data.obj.Product, ...
1
vote
1answer
22 views

Check to see if key,value pair in myArray is in the JSON and if not, add it in

I am trying to check to see if a key,value pair in my array is found in the response JSON and if it is not, then I want to add it to the JSON. $scope.myArray = [{ "Product_type": "T" }, { "...
0
votes
2answers
25 views

How to print objects to screen user using Ionic2

I have an API with several values inside. I want to show the values on my screen to the user using kind of label or something. Array with objects Each object has some values like lat and longitude: ...
0
votes
1answer
13 views

Get array updated from factory (Angular js)

I have an array declared in the factory with the name "voci", then i have a controller that update the array with a function "CalcolaTotaleEuroPagine", what i want is to access to the array "voci" ...
0
votes
0answers
18 views

Angular Js Search element with promise

Hi we have an angular js controller that call a service function: var decodedValue = StaticTableService.DecodificaAllergeni(listObj); this service function get an array of integer. We want to decode ...
-1
votes
0answers
23 views

Getting Array length as 0 when data is called from service in angular

I am calling a data from REST Services but I am getting the length of an array as 0, even if the array contains object. My code is as follows : $scope.amenityDetails = AmenityDetailService....
0
votes
2answers
59 views

ng-repeat ng-click showing only last value from an array

I am trying to show the details of each of my values from my data in a pop up window however, only last value from an array is shown three times instead of three different values. This is my html: ...
0
votes
1answer
45 views

How can we get array loop in controller in angularjs

How can we get data from loop of array like we get from ng-repeat use in our views? I want this: function test() { var data = []; for(var i = 0; i < 10; i++) { var newtest = { ...
0
votes
2answers
55 views

How to fetch values from array in javascript +angularjs

I want to get values from array index in javascript +angularjs like ng-repeat but in my controller Array[0] 0: Object class:"text-area" text: "Arif#2:hi bro" time_stamp: ...
0
votes
1answer
37 views

dynamic template adds empty value on ng-repeat

I have been trying to make a query builder for my own purpose. This plunker https://plnkr.co/edit/95VgJfH9nIScwApXyKOu?p=preview has my work so far, When I select a parameter and Click on add, it ...
0
votes
1answer
28 views

Use the first and last element (dates) in an array to create an obj.name in an Angular factory/service

I have an Angular service/factory method that takes as a parameter passed to it in the form of an array of arrays containing objects [[{},{}],[{},{}]]. The data contained in this parameter, consist ...