Tagged Questions
0
votes
1answer
30 views
AngularJS scope issue with $http
Continuing my adventures with AngularJS, I have what I believe is a scope issue, but not entirely sure.
In my controller I'm building two test array's for demo purposes, search.filterDemo and search....
-1
votes
1answer
48 views
set active item in select list with angularjs
I have this list:
Which comes from:
<select multiple size=11 ng-model="AvailableColumns" ng-show="NamesAvailable" ng-options="item for item in names">
<...
1
vote
1answer
35 views
Firebase and Angularjs Scope array of objects undefined
I am trying to display objects using angularjs. But in the html it appears as undefined.
app1.controller('ctrl1' , function($scope){
categories = [];
var dbRef = firebase.database().ref().child(...
0
votes
3answers
193 views
Angular: Updating $scope with new data causes old data to remain when using ng-repeat
I'm having a strange issue where I replace the values in $rootScope.data.vehicles with new data but the old data points on my view remain for about one second alongside the new data.
For instance, ...
-2
votes
2answers
32 views
Access inner value of an object assigned in scope
I want to console log a value from my object but it returns an undefined value.
$scope.sidsamp = [{todoText:'Clean House', done:false}];
$scope.todoAdd = function() {
$scope.sidsamp.push(...
0
votes
2answers
78 views
AngularJS- Items within ng-repeat not updating on variable update
I have an array called altSegments, and based on $scope.firstSeg or $scope.lastSeg I'd like to display different parts of that same array. In most cases I change the altSegments array alltogether and ...
1
vote
1answer
40 views
AngularJS not putting an array in scope?
So I'm attempting to use Angular JS and the angularSoundManager module to create a music player. I can get songs and the player to work fine, but when I tried changing the main array to be albums with ...
3
votes
1answer
176 views
How to properly reset angularjs v1 factory after certain function
I Made a factory that keeps the information in my scopes in a series of 6 pages. Now when the user completes the 6th page and pushes the object I want the factory to reset to empty arrays again.
I ...
0
votes
1answer
57 views
Data Array Always Process to String not Array With Angular.fromJson
I have a problem, I did set field form to array. Example : Field dfp_interest in response is []. So, i must set my data to array right ? I did and success in console.log. Result like --> ["5","6"] but ...
2
votes
2answers
889 views
Check if array has a particular index in AngularJs
In AngularJS expressions, how can I check if an array has value in a particular index or not? Consider the following example
$scope.arr =['one','two','three'];
In HTML.
<p ng-show="arr[3]!=''"&...
3
votes
3answers
146 views
NgRepeat is not updating from an updated array
I have an app that gets a collection of data (i.e. 400 objects) and stores it in an array. In my view I'm creating a kind of infinite scroll, that basically when the page loads, it insert 5 records. ...
-1
votes
2answers
110 views
Convert text input to lowercase - Javascript
Having trouble creating a case insensitive search in my Ionic app. I have the following that pushes tags into firebase. How can I convert the entire array to lowercase before going into the database?...
0
votes
3answers
62 views
Convert Object to Array angularjs with dynamic value
{"13":"I","14":"E","15":"V","16":"G"}
to:
['I', 'E', 'V', 'G']
where the 0 property of objects have the array of 1 and 2 objects? Is there a way to do that?
<div ng-repeat="data in data" >
&...
2
votes
4answers
94 views
Angular - loop over nested javascript arrays
How can I use ng-repeat to loop over data that contains many nested array data?
I have data that will have many "Segments"
Example:
confirm.booking.flightData[0].Segments[0].FlightNumber
...
0
votes
1answer
82 views
How to access objects returned by a service from within controllers
I have a service that returned array of objects to a controller , the console
showing the below response :
Array[0]
0
:
Object
first_name
:
"Emi"
id
:
"255860959988416847"
last_name
:
"Hauritz Seino"...
0
votes
1answer
56 views
how to iterate through an array and display it in $scope (angularjs)
Problem:
I am showing a list of documents in my application and one of the fields is a preview icon which shows a modal to display a pdf preview of the document. I am building a url to make it ...
0
votes
2answers
260 views
angularjs ngmodel value with two values
I have this dropdown control
<div ng-repeat="prop in props" style="margin-bottom: 10px;">
<label class="col-md-4 control-label">Property {{$index + 1}} ({{prop.Value}})</label>
&...
0
votes
0answers
73 views
Inline edit function not working using angularjs
I really hope that you can help me. I have problem where i want to make CRUD operation. I successfully create add and delete operation but I can't create for edit function. My vision is to have a ...
1
vote
2answers
171 views
How to get second value variable in an array from dropdown selection in controller?
I'm looking to get the variable of the second value in an array list that a user selects via dropdown in my controller to do some math functions.
$scope.dropdown = [
{name:'Name', value:'123'}]
So ...
0
votes
2answers
26 views
AngularJS filter data based on JSON records
I have a JSON file and want to print <divs> based upon address of resturants but I want to group them based upon the 'r.Address' field. Like all records with 'Address' Delhi should show first ...
1
vote
2answers
3k views
Angular ng-repeat to print array values in a HTML table
I have an array in my app.js file, contents of which I would like to print sequentially in <td> rows in my HTML table.
Below is my app.js file:
(function () {
var app = angular.module('TravelI'...
0
votes
4answers
62 views
Angular JS form submission issue
I want to add an entry to my reviews array.
<b>Submit a review</b>
<form name="submitReviews" ng-controller="ReviewController as reviewCtrl" ng-submit="reviewCtrl.addReview(...
1
vote
1answer
315 views
Get JSON array object specific Id depending on which item i click on AngularJS
So i have a table with a list of teams, what i want to do is when i click on a team name it displays a new view with team details. There is 2 controllers, 1 to get league table and fixtures and then 1 ...
-1
votes
1answer
104 views
sending multiple array in multiple array in Angular js
How to send this data in AngularJS. (It's a multiple array in a multiple array which need to send on one Object)
[{
"working_day":"sunday",
"from_time":{"hour":"9","min":"30"},
"to_time":{"hour":"6","...
0
votes
1answer
271 views
Update text area when scope is changed
So I have a text area defined with an ng-list that will separate the elements in an array into their own line.
<textarea data-ng-model="names" data-ng-list=" " data-ng-trim="false">&...
0
votes
0answers
48 views
Javascript array push problems [duplicate]
I want to store dates taken from a GET request into the array vm.dates. For doing this I use the function push(), later, I want to check whether the date is contained in the array or not.
The problem ...
0
votes
1answer
353 views
How to push array to nested child object of only matching parent properties?
Below is my JSON structure:
$scope.dataList = [{
CompanyName: null,
Location: null,
Client: {
ClientId: 0,
ClientName: null,
Projects:{
Id: 0,
Name: null,
...
1
vote
2answers
130 views
search does not work if the terms have space
I have an angular search on multiple fields. My search works as long as there is no space in the search term. But if a field has a space, it will break. This is happening because I am trying to ...
1
vote
2answers
28 views
How to update angular child scope by an array
I'm getting an array of data from server and going to update the $scope in angularJS.
The initial value is :
$scope.form = {};
I want to update dynamically like this:
$scope.form = {"firstname" : "...
0
votes
2answers
292 views
How to give value of textbox to ngModel textbox using javascript
This is my first html textbox with javascript code
<div>
<input type="text" onchange="getTheValue(this)" id="12345" />
</div>
and this is my second html tag
<input type="hidden"...
1
vote
1answer
661 views
Get dynamic scope array variable value in angularjs
I have a scope array variable which i am trying to access dynamically. Its value has been already set.
Its like this.
$scope.setp = { arr: [] };
$scope.setp.arr[0] = "sample Value";
When I am ...
0
votes
0answers
76 views
Cannot access javascript array
I have a function in a factory which returns an array (highestEd is an array defined above).
dataService.listHighestEd = function(){
return highestEd;
}
When I store returned value into a $scope ...
1
vote
2answers
60 views
Unable to edit Input when using split() in angularJS
I have a nested JSON object which has array for one of the property in it.
The array items has ';'.
What I'm trying to achieve is to treat ';' as a delimiter and then split the array item further to ...
1
vote
2answers
395 views
angular $scope.$watch on array calling update function
In my plunk I have an array of integers, that I have attached $scope.$watch to. When I update the array, my $scope.$watch isnt firing a console.log. Why is my console.log not being called?
<!...
2
votes
1answer
48 views
How do I get data from a server for each element in an array in AngularJs
Let us consider I have an array:
var friendRequests=[
{
id:"Xyz",
requester:"person 1"
},
{
id:"Xyz2",
requester:"person 2"
}]
this array iterates ...
2
votes
3answers
379 views
Why array in $scope doesn't updated using array concat method?
When I use concat method, my $scope is not updated
var anotherList = ["2", "3", "4"];
$scope.list = [];
$scope.list.concat(anotherList);
But using array push method in a loop, my $scope gets ...
0
votes
0answers
57 views
Javascript / AngularJS array with an operator to use
I have some trouble with creating a price Alarm for my AngularJS app.
I want the user to put in an alarm value and an operator for if the alarm just trigger below or above x price.
<ion-radio name=...
1
vote
2answers
686 views
ng-repeat not updating when pushing objects to the array
I have been taking a course on Angular JS on Coursera and I am having trouble with ng-repeat not updating my view after I push something on the array using a form. When I tried to log the contents of ...
4
votes
5answers
216 views
How to create $scope functions that never reads $scope?
I want to create a $scope function that will only manipulate the variables that it receives.
I've made a working Plunker to test things out.
I have a ng-repeat that is just listing names and id of ...
0
votes
1answer
125 views
Form is data-binded to a ng-model inside ng-repeat… but all repeated values are changed?
I am making a simple web app that allows users to select food items and customize their order (drink, sides and toppings). The approach I am taking is for each food item to have the following ...
1
vote
2answers
1k views
multi select check box with ng-model angular js
I have the below controller setup so that I can add the checked values into an array as shown below.
(function (app) {
'use strict';
app.controller('SimpleArrayCtrl', ['$scope', ...
0
votes
1answer
120 views
passing $index from one ng-repeat to another
I want to iterate over a list, for example:
$scope.articles = [
{ id: 1, name: "Pizza Vegetaria", price: 5 },
{ id: 2, name: "Pizza Salami", price: 5.5 },
{ id: 3, name: "Pizza Thunfisch", ...
1
vote
2answers
45 views
Array at index within the size of array is undefined
I need to create an array initialized to the length of an object. Then be able to insert new data into an index within the array.
Code example:
$scope.holder = new Array($scope.x.length);
$scope....
1
vote
0answers
357 views
How to merge 2 arrays in Angular templates
I have a form directive in angular for displaying errors that looks like this:
<form-error errors="form.errors.some-array"></form>
The problem is that my form.erros object contains 2 ...
0
votes
1answer
68 views
What's the deal with declaring empty array's to $scope at the beginning of a function? (in AngularJS)
Why do I see stuff like this:
$scope.formData ={};
In this case (if used for forms), I'm assuming it's for clearing the previous data (in this case a form) if it were to be called before it's ...
0
votes
1answer
104 views
Refresh array items of scope in angular.js
I have an array with x items. I need to copy this items and add a few more, but when I show the items in the ng-repeat I copy the firsts again.
How can I delete the items and put the new in real time?...
0
votes
1answer
339 views
Getting out values from an array using angular.foreach in $scope
I have a dynamically changing array based on another code and I'm trying to retrieve specific data from the same.
Here is a sample of one dynamically generated array under $scope.filtereditem:
[{
"...
0
votes
1answer
38 views
How to turn an array of objects into an array of arrays in Angular?
Original array of objects:
$scope.items = [
{
'name': 'Apple',
'value': 10,
'color': 'green',
'size': 'medium'
},
{
'name': 'Kiwi',
'value':...
0
votes
2answers
99 views
iterate through a list of properties in object in angularjs
I have this object with arrays:
"{
"Drivers":[
{
"Id":"41ba341a-e50f-4878-b55e-6c96ef5027b0",
"FirstName":"John",
"LastName":"David",
"...
0
votes
1answer
107 views
AngularJS - Compare & Replace objects between 2 arrays
I have the following 2 arrays $scope.oldArray & $scope.newArray
$scope.oldArray = [{
"status": "New",
"priority_summary": "High",
"u_id" : 1
}, {
"status": "New",
"...