FAQ Database Discussion Community


Directives inside ng-repeat to create a new structure with AngularJS

arrays,json,angularjs,ng-repeat
I'm trying to create a new array from an exiting array of parameters with AngularJS. Explaining better: I have an array of parameters: "parameters": [ {"id":2,"exibitionName":"gaps","name":"--gaps","description":"Nº de GAPS permitido","defaultValue":null}, {"id":4,"exibitionName":"Block Size","name":"--block-size","description":"Tamanho dos blocos","defaultValue":null} ] With this array I create with ng-repeat a set of inputs to take the respective value...

Store value in a directive for later use

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I would like to save an object in a ngRepeat so that I can use that object in its children, like shown in this code: <div ng-repeat="bar in foo.bar> <div ng-repeat="qux in baz.qux" myvalue="{'item1':foo.var1, 'item2':qux.var2}"> <div ng-click="myFirstFunction(myvalue)"></div> <div ng-click="mySecondFunction(myvalue)"></div> </div </div The object I want to generate and then use...

AngularJS ng-repeat orderby doesn't work properly with greek words

javascript,angularjs,sorting,sql-order-by,ng-repeat
It appears that when I use the orderBy filter inside ng-repeat, in order to sort alphabetically an array of objects by some property, the results I get are wrong. Specifically, orderBy places first all strings starting with letters with accent such as Ά, Έ, Ή, Ί and so on, ignoring...

Render multiple values, separated by line break, within a textarea

javascript,html,angularjs,textarea,ng-repeat
I am rendering a dynamic form in angular. When attribute has multiple values I wish to render them within a textarea. Each value on its own line. But cant't get it to work! This is what I have so far: <script type="text/ng-template" id="form_field_text"> <label for="{{field.displayName}}">{{field.displayName}}</label> <br /> <div ng-if="field.multivalue ==...

AngularJS - directive with a dynamic array of objects in form

angularjs,directive,ng-repeat,angularjs-ng-model
I'm trying to create a form that has a dynamic set of input boxes. I'm trying to get ng-models to work with array items and I am clearly doing something wrong. My problem seems to be indexing the scope array lineItems in the template. Here is my jsfiddle: http://jsfiddle.net/dk253/9ykuuobq/ Here...

AngularJS ng-repeat is creating three empty rows when filling table with JSON array

javascript,arrays,json,angularjs,ng-repeat
I found two other issues posted here experiencing a similar problem, but I'm fairly certain that my problem is not related to tags and instead an issue with the ng-repeat function in Angular. I am using a loop to create the HTML string which can be used to fill all...

AngularJS: How can I use $index in onclick

angularjs,indexing,ng-repeat
So, I'm using $index to create different ids for each radio button inside a ng-repeat. I'd like to reference those ids inside local events (not ng- events). I made an example in this plunker In this example, I'm using always the element radio3, but I'd like to reference the correct...

can't center align text when using ng-repeat

angularjs,ionic,ng-repeat
I'm building an Ionic app, but have run into a minor problem that I don't understand and can't seem to resolve. I have a ion-item that is hardcoded and an ion-item that is generated using ng-repeat. I'm using css to center the text in both of them, however, the ion-item...

ng-repeat except value 2

angularjs,conditional,ng-repeat
I have something like that: <div ng-repeat="element in data.arrayElement"> <strong>{{element.name}}</strong> </div> The previuos collection have 5 elements. Can i iterate the collection except the element that has the value 2?. I don't know, maybe like this <div ng-repeat="element in data.arrayElement | filter:element.val() !== 2"> <strong>{{element.name}}</strong> </div> ...

Improve performance ng-repeat list 750 elements

angularjs,performance,ng-repeat
wanna know the best way to improve performance in my scenario a list of 750 elements filtered in real time and with the requirement of no pagination or limit the list, the 750 elements sould be on screen and need to be filtered as fast as posible in real time...

Ng-repeat in Angular bind to HTML template in object {{ key.value }}

angularjs,ng-repeat
I've got an object in a service I'm trying to represent in the page markup. Notably a description key in the object that stores the local address of an HTML file with the relevant description. Here is the object I'm referencing: service.content = [ { id: 'bootstrap-grid', title: 'The Complete...

Why doesn't AngularJS want to list array items if a value repeats?

javascript,angularjs,angularjs-ng-repeat,ng-repeat
It took me a long time to debug where the fault was when I was trying to list some stuff from a database. It turns out that if there are values in an array that are duplicates, Angular refuses to use the array at all in ng-repeat. An example of...

AngularJS ng-repeat directive with complex nested data structure and dynamic keys

javascript,angularjs,angularjs-ng-repeat,ionic-framework,ng-repeat
I'm having trouble implementing this data structure in angularjs using ng-repeat. It may be that I'm using the wrong method altogether. All I know is that I could do this fine using handlebars but struggling to replicate in ionic/angularjs { "germany": { "tournaments": { "2. Bundesliga": { "fixtures": [{ "c":...

onFinishRender not being fired

angularjs,angularjs-ng-repeat,ng-repeat
Plunker I'm loading data into a table using ng-repeat. There is an onFinishRender, which emits ngRepeatFinished. However it's not being fired. Any ideas why it's not working? logsmgr.directive('onFinishRender', function ($timeout) { showLog("onFinishRender"); return { restrict: 'A', link: function (scope, element, attr) { if (scope.$last === true) { $timeout(function () {...

How to look up items with id for one controller from another controller in AngularJS

angularjs,controller,ng-repeat
I have two controllers where the first one contains a list of items: $scope.items = [{id:1, desc:'desc1'},{id:2, desc:'desc2'}...]; The second one binds to a template which displays a list of items selected: $scope.myitems = [1,2,3,...]; // ids only <div ng-repeat="item in myitems"> {{item.id}} / {{item.desc}} </div> How can I look...

angularJS create css friendly class name from data value

angularjs,ng-repeat
I need to convert a data value into a friendly css class name. My category title is accessed as {{catTitle}} but I also want to apply a background image to the div containing the title. I have a series of css classes to handle the images and these match the...

With angular, how do i call the result of a custom filter in a ng-show?

javascript,angularjs,filter,ng-repeat,ng-show
I have a dictionary with some datas. I'm filtering these datas with a custom filter which looks the current date and compares it with the date of the schedule. If the current date is between the dates of the schedule, it displays the schedules. My problem is I want to...

Multiple Iterations with AngularJS ng-repeat

javascript,angularjs,ng-repeat
I've searched for a while and did find a lot about multiple iterations. The problem is that i don't see a plain solution for my problem. I have a list of checkbox that is filled dinamically with ng-repeat. Due to layout purposes i need to create a new div inline-block...

ng-model in ng-repeat; get value of ng-model

javascript,angularjs,ng-repeat,angularjs-ng-model
I have following weird situation - Controller snippet - $scope.filterNum = {0: 'filterVal1', 1: 'filterVal2', 2: 'filterVal3', 3: 'filterVal4', 4: 'filterVal5', 5: 'filterVal6', 6: 'filterVal7', 7: 'filterVal8', 8: 'filterVal9', 9: 'filterVal10', 10: 'filterVal11', 11: 'filterVal12', 12: 'filterVal13', 13: 'filterVal14', 14: 'filterVal15', 15: 'filterVal16', 16: 'filterVal17', 17: 'filterVal18'}; $scope.operatorNum = {0:...

Ng-repeat on directive creating duplicate DOM elements

javascript,angularjs,ng-repeat
I have directive that renders a d3 scatter-plot directive on the DOM. I also have an ng-bind bound to an array that lists the inputs provided for the given scatter-plot. Both of these elements, the scatterplot and inputs, are inside of a span with ng-repeat, like this: <section> <h3>Saved Charts</h3>...

ng-repeat dynamic variable name

angularjs,angularjs-ng-repeat,ng-repeat
I am implementing ng-repeat to create elements for a bootstrap accordion interface. I have ng-repeat working however the issue I have is that I need to dynamically create the ID in order to target the accordion element individually. My ng-repeat HTML block references: <div class="panel-heading" data-toggle="collapse" data-parent="#products-accordion" href="#collapseOne"> And lower...

ng-repeat with ng-click inside a directive

angularjs,angularjs-directive,angularjs-scope,ng-repeat,angularjs-ng-click
I am trying to create a simple autocomplete tag directive. But the ng-click on the dropdown menu <li> won't fire. I am sure this is some sort of scope issue, but I don't get why. Can someone please show me how to get this ng-click to fire? thanks! here is...

Angular JS, remember checkbox status when filtering

angularjs,checkbox,ng-repeat,angularjs-filter
I'm trying to create a list with checkboxes with a search box. HTML <div ng-controller="MainCtrl"> <input type="text" placeholder="Search" ng-model="query"> <div ng-repeat="item in items | filter:query"> <input type="checkbox" id="{{item.id}}" value="{{item.id}}">{{item.name}} </div> </div> JS myApp.controller('MainCtrl', function ($scope) { $scope.items = [ { "id": 1, "name": "Green", }, { "id": 2, "name": "Yellow",...

Angular display product info in modal after clicking an ng-repeat thumb

angularjs,modal-dialog,ng-repeat
I have just started learning angular! I have a 'quick view' button on my list of product thumbnail images, the button and images are generated using angular ng-repeat. I need to display the appropriate product description/price etc (from my json file) in a modal when clicking on 'quick view' but...

ng-repeat wont iterate over nested JSON arrays

angularjs,ng-repeat
I have a problem. I can't get ng-repeat to show any data in my html side. It's a $http.get to a JSON obejct with nested arrays. HTML: <head> <script data-require="[email protected]" data-semver="1.3.15"src="https://code.angularjs.org/1.3.15/angular.js"></script> <link rel="stylesheet" href="style.css" /> <script src="script.js"></script> </head> <body ng-app="stdViewer" ng-controller="stdCtrl"> <h1>Hello Plunker!</h1> <div ng-repeat="IKAS_standarder in data">...

How to display all the nested json data using ng-repeat?

json,angularjs,angularjs-ng-repeat,ng-repeat
This is my JSON data: "multipleLayerDropdown" : [ {"title":"Google","url":"#"}, {"title":"Another action","url":"#"}, {"title":"Something else here","url":"#"}, {"title":"More options", "submenu":[ {"title":"Second Level 1","url":"#"}, {"title":"Second Level 2","submenu":[ {"title":"Third Level 1","url":"#"}, {"title":"Third Level 2","url":"#"} ]}, {"title":"Second Level 3","url":"#"}, {"title":"Second Level 4","submenu":[ {"title":"Third Level 1","url":"#"}, {"title":"Third Level 2","url":"#"} ]} ]} ] I would expect something like...

Weird behavior of ng-repeat scope

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I have this piece of HTML: <div ng-switch="view"> <div ng-switch-when="products"> <input class="form-control" placeholder="Search" ng-model="searchText" /> <ul ng-show="products && products.length > 0"> <li class="head"> <div class="column col-select"><input type="checkbox" ng-model="$parent.allSelected" ng-change="$parent.selectAll($parent.allSelected)" /></div> <div class="column col-name">Name</div> <div class="column col-code">Code</div> <div...

$compile and ng-repeat not returning correct element

javascript,angularjs,compilation,ng-repeat
I can't get $compile to work manually with ng-repeat. There is a similar question here: ngRepeat in compiled by $compile does not work, but it doesn't resolve the issue here, as I manually call $digest on the scope yet it still doesn't work. The code I am referring to is...

AngularJS - Filter out single object in nested data structure

angularjs,filter,nested,ng-repeat
Data var data = { "records": [ { "name": "Spectrum Series", "seriesid": "SpectrumSeries", "book": [ { "name": "White Curse", "bookid": "WhiteCurse", "image": "book1" }, { "name": "Blue Fox", "bookid": "BlueFox", "image": "book2" } ] … other series } Controller dnleoApp.controller('BookCtrl', function ($scope, $routeParams) { $scope.mybookid = $routeParams.bookid; $scope.myseriesid = $routeParams.seriesid;...

AngularJs “ng-repeat-start” with table

javascript,angularjs,multidimensional-array,angularjs-ng-repeat,ng-repeat
I have an object in this format, I am trying to print it as a table. [{categoryName: "category1", value:[{name:"item1.1"}{name:"item1.2"},...]}, {categoryName: "category2", value:[{name:"item2.1"},...]},...] So, categaory name should be the header and values under it should be subheaders, as in the colspan of categoryname should be equal to number of values in...

ng-repeat (iterate) over complex json object in Angular

javascript,json,angularjs,ng-repeat
One controller returns me a very complex json object: { "184": { "title": "THE STONE ROSES", "sessions": { "1443564000000": { "num": 5 }, "1442959200000": { "num": 1 }, "1447196400000": { "num": 1 }, "1444428000000": { "num": 2 }, "1446332400000": { "num": 3 } } } } I have tried to...

Why do CSS transitions occur for unshift() and not for shift() in ng-repeat lists?

javascript,arrays,angularjs,css-transitions,ng-repeat
I'm moving some elements in the page using ng-repeat and CSS transitions. If I change the data array using unshift the list transitions nicely. (In my application I'm transitioning position as well as opacity.) If, however, I use shift to update the array, the DOM is updated immediately with no...

AngularJS ng-options from CakePHP Data

angularjs,cakephp,angularjs-ng-repeat,ng-repeat
I have some json data I receive from a cakePHP server. this is a snippet of what is found in my current $scope.catalog.ConstructionMethod ... [ { "ConstructionMethod": { "id": "99", "title": "All Plywood", "price": "0.12" } }, { "ConstructionMethod": { "id": "139", "title": "Plywood Sides", "price": "0.05" } } ]...

Angular error with ng-repeat

javascript,html,angularjs,ng-repeat
The last three hours I made a little app. It's not ready yet, but there is an error. I can not figure out, what's wrong. Here is my HTML: <html lang="en" ng-app="reporting"> <head> <meta charset="utf-8" /> <title>.reporting</title> <!-- BOOTSTRAP --> <link href="Content/bootstrap.css" rel="stylesheet" /> <!-- BOOTSTRAP --> <!-- JQUERY -->...

ngRepeat track by: How to add event hook on model change?

javascript,angularjs,angularjs-ng-repeat,ng-repeat,angularjs-track-by
I have a simple ngRepeat like the following: <some-element ng-repeat="singleRecord in arrayOfRecords track by singleRecord.id"> <!-- stuff --> </some-element> arrayOfRecords is updated from a server and may contain new data. ngRepeat's track by feature can figure out when a new element is added to the array and automatically updates the...

ng-repeat display range

angularjs,angularjs-ng-repeat,ng-repeat
I want to display ranges like 3 4 5 6 or 6 7 8 9 How can I do this? <div ng-app ng-controller="MainCtrl"> <ul> <li ng-repeat="num in nums">{{num}}</li> </ul> </div> Here is my code: http://jsfiddle.net/duketopmost/n9brs8hh/ Thanks a lot. ...

How to divide data to half while using ng-repeat?

javascript,angularjs,filter,ng-repeat
I've have some data and i'm able to compile this data to div with using ng-repeat. I'm trying to divide them to 2 columns and cound't find a way to build it. Here is my example: ( jsFiddle ) html: <div ng-controller="Ctrl"> <div class="left"> <div ng-repeat="item in data">{{item.value}}</div> <!-- i've...

Need help in ng-repeat

angularjs,filter,ng-repeat
My code I want to repeat slides only in sliderOne for which I have added filter as below. <div ng-repeat="slider in sliderData " > <div ng-repeat="slide in slider | filter : sliderData" >1</div> </div> I am not getting where I am going wrong. All slides are getting repeated....

Use AngularJS nested ng-repeat to create elements

angularjs,ng-repeat
I am working with angularjs ng-repeat. I have this code: angular.module('app', []) .controller('MainCtrl', function($scope) { var items = [1,2,3,4,5,6,7]; $scope.items = items; }); I want to have html result like this: <ul> <li> <a href="">1</a> <a href="">2</a> </li> <li> <a href="">3</a> <a href="">4</a> </li> <li> <a href="">5</a> <a href="">6</a> </li>...

ng-hide or ng-show does not work if its controlled from within a ng-repeat

angularjs,ng-repeat,ng-show,ng-hide
I am trying to hide the div if any of the buttons in the ng-repeat is clicked. However it doesn't seem to work, it leads me to think if ng-hide or ng-show won't work if it is controlled from within a ng-repeat? <div data-ng-hide="showChooseHardware"> <table class="table"> <tbody> <tr data-ng-repeat="hardware in...

Angular - Data Returned But ng-repeat Not Displaying It

angularjs,angularjs-ng-repeat,ng-repeat
I'm having an issue where although my Angular JS is returning data from my backend, I can't get ng-repeat to display it. Here's my HTML file: <!DOCTYPE html> <html ng-app="docManager"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"> <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script...

Angularjs make invisible accordion if subelement are filtered

angularjs,filter,accordion,visibility,ng-repeat
i have created an accordion dynamically with angular. Code: <input type="text" class="form-control pull-left" ng-model="searchSingoloCampo.title"> <accordion-group ng-repeat="category in categories"> <li ng-repeat="resource in category.resources | filter:searchSingoloCampo"> </li> </accordion-group> The accordions is generated by a list , and inside each accordion there is a sublist of elements. I can filter the element inside...

Reply Textarea for particular post(using textarea), opening for all the comments

angularjs,angularjs-directive,angularjs-scope,angularjs-ng-repeat,ng-repeat
Hi I am trying to implement facebook kind of post and reply comments using angularjs. Below is my code <doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script...

Angular ng-bind-html inside a nested ng-repeat

angularjs,ng-repeat,ng-bind-html
So I have an ng-repeat within an ng-repeat. The inner ng-repeat references "item in recipe.ingredients". The problem is that each of these "items" have special characters which don't render unless I use ng-bind-html. But when I attempt to use ng-bind-html it doesn't work. Here is the html: This works but...

Angularjs ng-repeat over an array in objects

arrays,angularjs,ng-repeat
I want to itterate through elements which are in array which is in object using ng-repeat. This is what i have done so far: Controller: app.controller('videoDisplayCtrl', function($scope){ var videos = [ { title: 'Course introduction', pictureUrl: 'https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS_kNT5UnXz5dQ6tId9YO0wIJ7YSgRvD1SUxyfdXcXZVdOH7z4b', length: '3:32', category: 'IT', subscribers: 3, date: new Date(2014, 12, 15), haveSubtitles: false,...

Editable Table Cell in AngularJS

javascript,angularjs,ng-repeat
I am extremely new to most of this so my apologies, my code is mostly beg borrowed and fudged from this forum and I am learning as I go along. Currently I am trying to replicate a heater timing system, each day has 6 switches which can alter the temperature....

how to make first element in ng-repeat

angularjs,angularjs-ng-repeat,ng-repeat
i have a task to make name of user first of all list. Heres the example $scope.items = [John,Bob,Tanya,Owen,George]; <div ng-repeat="item in items"></div> The result will be: John Bob Tanya Owen George How can i make that Owen will be first like: Owen John Bob Tanya George ...

add class to a specific ng-repeat item and stay on that item

angularjs,ionic,ng-repeat
I'm working on a chatapp. The messages in the chatapp are populated with ng-repeat. When the user logs out of the app or closes the app I want the current last item (message) in the ng-repeat list to be marked with a class name and that it stays with that...

How to not repeat child but bind parent with ng-repeat in AngularJS

angularjs,ng-repeat
I have a structure like this: Items is an array of objects and itemName is different for each repetition also in an array. The following structure works with the Items array but how can I change the itemName to be different for each repetition? <div ng-repeat="Item in Items"> <div>{{itemName}}</div> <ul...

Get the images from the array object index that corresponds with the album name of what the user clicked

javascript,arrays,angularjs,object,ng-repeat
I'll try to explain this as thorough as possible. What I need to do is use ng-repeat on an array of images inside of an object, which also sits inside an array. The number of objects in the main array are the number of albums that contains images that the...

Unique Identifier For Elements of a List Parsed By ng-repeat in AngularJS

javascript,html,angularjs,angularjs-ng-repeat,ng-repeat
I need to repeat through some list that is present in variable "tab.excelFields". I have been successfully able to do that, simple ng-repeat. The code is shown below: <tr> <th ng-repeat="field in tab.excelFields" class="btn btn-danger" style="display:table-cell;" id="{{id}}">{{field}}</th> </tr> Notice {{id}} field. I need to put in unique values here...1,2,3 and...

AngularJS - Trouble with ng-repeat

javascript,angularjs,ng-repeat
Here's the data I'm working with: $scope.products = [ { 'id': 643, 'name': 'Product Name', 'applications': [ { 'id': 100, 'name': 'Adobe After Effects CC (2014)', 'gfx': [ { 'id': 514, 'name': 'Graphics AE Test 1' } ] }, { 'id': 101, 'name': 'Adobe Premiere Pro CC (2014)', 'gfx': [...

AngularJS Script to run after ng-repeat elements are loaded

angularjs,angularjs-directive,lazy-loading,ng-repeat,angular-services
I have a problem that I wasn't able to solve even looking to other posts on Stackoverflow. I'm making an App with AngularJS, and I would like to pick some links of images from my Json that stays on an apache2 server and swipe them like in a carousel. When...

Assigning unique value ID to ng-repeat

javascript,angularjs,ng-repeat
OBJECTIVE I am looking to extend CodeSchool's "Shaping up with Angular" tutorial. My goal is to have a user click a thumbnail which re-renders the current product image. Product images are held within a JSON file - each product has an array of multiple images. DEMO http://plnkr.co/edit/l6zqpnpTaCghjOi5zt9b?p=preview product.js app.directive("productGallery", function()...

Angular ng-repeat array

javascript,arrays,angularjs,ng-repeat
I'm using Angular v1.4.0-beta.4 and need to iterate an array inside a scope like that: $scope.users = { name:'PC Admin', login:[ { proto:'https', user:'admin', pass:'foobar' }, { proto:'ssh', user:'root', pass:'strang3' } ], ip:'192.168.1.2' } I have looked at Angular ng-repeat docs but can't figure it out. I tried many things...

Angularjs filters when used in combination with each other

javascript,angularjs,ng-repeat
Ok so I was watching a YouTube video about Angularjs and on one of the lines of code, they were using two filters. It went something like this: <div ng-repeat="item in event.events | orderBy: 'date' | limitTo: '2'" ...> My only question is on the order of operations here. This...

Angular JS ng-repeat filter only items with a property

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I have a json file with keys like [ { "message": "Verify envelopes are properly loaded.", "hasFigure": false, "figureX": 0, "figureY": 0 }, { "message": "Verify the paddle is in the down position.", "hasFigure": true, "figureX": 185, "figureY": 50 } ] I need to put this into an ng-repeat but...

build a form using multiple ng repeats how to proccess the data? angular js

angularjs,angularjs-ng-repeat,ng-repeat,ng-submit
Im building a cart. Each product has "addons" these for example size:big dressing: No salad dressing Drink: cola these "addons" are from the database. and returned from the API as objects. object looks like this: object cat_addons (addon_group) -object (addon) -object - etc object item addons (addon_group) -object (addon) -object...

Can't get angular.js to loop through array and post to html

angularjs,ng-repeat
Edit: changed ng-controller to ng-app in body tag, was typo I'm new to angular and im trying to use ng-repeat to post all items in the products[] to html but the {{expressions}} come out as text rather than computing. I don't have my laptop so I'm testing all this on...

Nested NG Repeating

angularjs,twitter-bootstrap,angularjs-ng-repeat,ng-repeat
I have a JSON object (see below) which represents Categories and inside Categories there are Products. Having read bout ng-repeat it seems I need to create an ng-repeat to render the HTML blocks for each category, but also for each of the products within the category there is a similar...

Directive displaying Error: [$parse:lexerr] after moving template to templateURL

angularjs,angularjs-scope,angularjs-ng-repeat,ng-repeat,angular-directive
I have a directive working without any issues when the HTML markup is written in the template section of the directive. I've just moved the HTML markup in a .html file and on load of the page, i am seeing: Error: [$parse:lexerr] http://errors.angularjs.org/1.3.14/$parse/lexerr?p0=Unexpected%20next%20character%20&p1=s%2016-16%20%5B%5C%5D&p2=option.name%20%3D%3D%3D%20%5C'choices%5C' Original directive: app.directive('myDirective', function () { return...

Angular custom filter doesnt work on server

javascript,angularjs,angularjs-ng-repeat,ng-repeat,angularjs-filter
I am learning Angular so I created casual To do app. Custom filter works on localhost while on hosting it doesnt. I don't get any error messages and data doesn't show. If i remove taskPriority:this from li data shows which means on the server everything is ok but then, of...

Memory leak in Ionic(or angular)?

javascript,angularjs,memory-leaks,ionic-framework,ng-repeat
I'm new to both Ionic and Angular, so I'm not sure where the problem would actually lie between the two(if either). I seem to have a problem with ng-repeat not clearing memory. I've written a bare bones example to demonstrate http://codepen.io/pen/pvQyxj index.html <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,...

have two objects in ng-repeat mixed/merged

arrays,angularjs,merge,angularjs-ng-repeat,ng-repeat
I've two objects, for example: [ { "some": "thing", "lol": "asd", "rotfl": "id321ddk", "hello": "world000" }, { "some": "thing2", "lol": "asd2", "rotfl": "oddddk2", "hello": "wwwworld2" }, { "some": "thing3", "lol": "asd3", "rotfl": "idkkk3", "hello": "worldd" } ] ^ the first: and now the second: [ { "id": 1, "img": "link",...

How can I render this irregular table with ng-repeat?

html,angularjs,table,angularjs-ng-repeat,ng-repeat
Here I have a json data as below: [ {"teacher":"Tom","student":[{"name":"stuA","project":"projectA"},{"name":"stuB","project":"projectB"}]}, {"teacher":"Jerry","student":[{"name":"stuC","project":"projectC"},{"name":"stuD","project":"projectD"},{"name":"stuE","project":"projectE"}]}, {"teacher":"Lee","student":[{"name":"stuF","project":"projectF"}]} ] And now I wanna render it into an irregular table like the picture: So how can I make it possible by using ng-repeat?It's really a confusing problem. here is the html code that makes the table...

Cannot use ng-repeat with a JSON from ajax call

javascript,json,angularjs,ng-repeat,ionic
i am having lots of trouble with json coming from ajax call and ng-repeat. I have posted my code here http://jsfiddle.net/7quj9omw/ so you can view in a more organized way, although i know it is not complete, running this will just get a massive error and it contains my local...

AngularJS - Display complex JSON data with a single ng-repeat

javascript,json,angularjs,nested,ng-repeat
I am trying to display all the books of some series. I used nested ng-repeat and it works well. However, due to some recent changes on layout requirements, I cannot use nested ng-repeat (I want a single list of books). I would expect something like below <ul> <li>book1 of series1</li>...

adding directives to a page using ng-repeat

angularjs,angularjs-directive,angularjs-ng-repeat,ng-repeat
I'm trying to add directives to a page using ng-repeat. Basically I want to do something like: <{{ currentDirective.directiveName }} ng-repeat="currentDirective in directiveList" /> Here's an example of what I'm trying to do in context. http://jsfiddle.net/s9hf758w/...

Bind ng-options to nested array within JSON object, within ng-repeat

json,angularjs,angularjs-ng-repeat,ng-repeat,ng-options
This is my first question, so please be gentle on me! I hope you can help. I am trying to define a select box (dropdown) within my HTML view using ng-repeat, so that I can create a select for each item in an array. I have successfully achieved this, but...

Number of objects in a ng-repeat that is filtered [duplicate]

javascript,angularjs,angularjs-ng-repeat,ng-repeat,angularjs-ng-model
This question already has an answer here: How to display length of filtered ng-repeat data 6 answers I'm using angularjs in a site and there I have a search input that filters a list on a view. This list is displayed with a ng-repeat that has a filter from...

protractor click specific element in repeater by binding

javascript,testing,protractor,ng-repeat,end-to-end
I know that question was asked in the past in some different forms, but still didn't find the exact answer. I need to find an element inside a repeater and click it. the repeater is a list of apps and I need to find specific app with attribute 'displayName' that...

Angular data binding object in value attribute of option in select

angularjs,select,ng-repeat,value
I have a select item which I'm populating using ng-repeat in option. I use angular's data binding to set the value of the selected item to my model. But for some reason the " in the json string are now turned into \" . Because of this I can't reach...

NG-Repeat doesn't update cleanly when scope is updated

angularjs,angularjs-ng-repeat,ng-repeat
So I have a list of workspaces: <li class="workspace-object" ng-repeat="w in workspaces | filter:searchQuery" ng-click="selectWorkspace(w)"> <a href="" class="workspace-link">{{w.name | titleCase }}</a> </li> That List gets updated in the database by some function, and then I call the loadWorkspaces function below, to re-populate the $scope.workspaces object $scope.loadWorkspaces = function() { APIService.getWorkspaces().then(function(data){...

undefined value when using ng-repeat in directive with AngularJS

angularjs,angularjs-directive,angularjs-ng-repeat,ng-repeat
I have a data structure that consists of a javascript object defining [a] branch of a tree-menu. One of it's properties is a 'subBranches' property which can be populated with other instances of the treeBranch class. I have a $scope.branch = new treeBranch(), and I have added and defined the...

AngularJS directive templates ng-repeat funny substitution

javascript,angularjs,angularjs-directive,ng-repeat
I'm struggling with angularjs directive templates. The {{variable}} works in a very strange way inside a ng-repeat, <div ng-controller="MyCtrl"> <h2>here i am</h2> <button type="button" ng-click="addItem()" class="btn btn-primary">Howdy</button> <div ng-repeat="item in items track by $index" itemlist></div> </div> <script type="text/ng-template" id="template.html"> <div> Howdy {{item.itemNum}} {{item.name}} </div> </script> var myApp = angular.module('myApp', []);...

trying to display json data with angularjs ng-repeat not working

javascript,json,angularjs,ng-repeat
I've seen so many ways to do this, but most are pretty old and I want to make sure I'm doing this correctly. Right now, the way I'm using isn't working and I feel like I'm missing something. I'm getting the JSON back fine, I just need to get it...

How to display only the results of hidden list using angular.js

angularjs,variables,ng-repeat,ng-hide
I'm new to Angular.js and have a bit of a problem. I have a list that is searchable by a local scope variable. However, I DO NOT want to display the list which by default is displayed just below the input field. I only want to display results of the...

Unable to load data using ng-repeat

angularjs,ng-repeat
I am new to AngularJS and trying to understand it. Currently, I am not able to load the data received from PHP using ng-repeat. However, I am able to trace the data in a controller function. Here is data I am getting from server (PHP) array(2) { [0]=> array(5) {...

Angularjs ng-repeat array - duplicate values

arrays,angularjs,ng-repeat
So I'm just starting with angular JS and am a little confused about ng-repeat when dealing with arrays. The below code doesn't work as is...but when I change dayNames to an object and give it key value pairs it's fine. var myApp = angular.module('exampleApp', []); myApp.controller("dayCtrl",function($scope){ $scope.dayNames = ["sunday", "monday",...

Angular ng-repeat once

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I have an angular ng-repeat function. it repeats all the items in my list perfectly, but i need the items to only show one time. HTML: <div class="list"> <div class="item item-stable" ng-repeat="departure in flightSource" padding="false" ng-click="custom=!custom"> <div class="center"> Terminal {{departure.airportResources.departureTerminal}} <div ng-hide="custom">hello</div> </div> </div> </div> JSON: As you can see...

Calling a function (eg. Date) inside ng-repeat

angularjs,angularjs-ng-repeat,ng-repeat
I'm new to Angular and this question most likely is a trivial one! <div ng-controller="index"> <table class="table table-striped"> <thead style="font-weight: bold;"> <td>Update Time</td> </thead> <tbody> <tr ng-repeat="doc in allDocuments | searchFilter:srcStr"> <td>{{doc.updateTime}}</td> </tr> </tbody> </table> </div> The above html renders as follows: Update Time 1419421439570 1418552500904 1418368139999 1417703400456 But these...

Getting updated values in ng-repeat Angular JS

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I am using ng-repeat, which is getting values from my db and putting it. Now i insert these values into input text which i update. Now i have a save button, which saves the updated values. I am not getting the updated values when i press the save button. Please...

ng-Repeat returning undefined within $scope.$watchCollection

angularjs,ng-repeat,ng-init
When I console.log(result) on line 5, it returns just fine. The console.log($scope.notes) on line 11 returns undefined. Any ideas? Here is my controller: $scope.$watchCollection = (['parent_id', 'parent_type'], function(){ $scope.loadNotes = function(){ $http.get('/api/notes/' + $scope.parent_id + "/" + $scope.parent_type).success(function(result){ console.log(result); $scope.notes = result; return result; }); } $scope.notes = $scope.loadNotes(); console.log($scope.notes);...

AngularJS ng-repeat creating three empty rows whien populating table & ng-repeat not repeating

javascript,arrays,json,angularjs,ng-repeat
I've looked for solutions to these problems, but Angular is very foreign syntax for me, and every method seems to do a lot behind the scenes. I'm a newb to web development and this is my first project consuming an API, using AngularJS, and I just started to explore JavaScript....

How to update view angularjs from data server (api/nodejs/mongodb) by click

angularjs,node.js,mongodb,express,ng-repeat
I would like to know how can I update a view from data server after an update with ng-click. I use Daftmonk Mean stack generator. I opened an other topic with code but no answer maybe I'm on the wrong way update/refresh angularjs ng-repeat with data from server Thanks for...

Fetching and storing data from form fields (email, password) without user clicking a button using Angular, Javascript

javascript,jquery,angularjs,angularjs-directive,ng-repeat
I am newbie to Angular and Java-script and trying to figure the following problem. I would appreciate any inputs. I have 2 fields in our div class. One of them is a form entry (email) and other one is a drop down menu which has some static values of "occupation"...

directive can not ''require:ngRepeat'

angularjs,angularjs-directive,angularjs-ng-repeat,ng-repeat,directive
I write below directive to make call a function when ngRepeat element gets rendered on UI. Directive directives.directive('repeatDone', function() { return { restrict: 'A', require: 'ngRepeat', link: function(scope, element, attrs, ngModel) { if (scope.$last) { scope.$eval(attrs.repeatDone); } } }; }); But it is giving $compile error. If I remove require...

Dynamically add UI Bootstrap dropdowns with ng-repeat

angularjs,drop-down-menu,typescript,angular-ui-bootstrap,ng-repeat
I'm new to using AngularJS and UI Bootstrap and I'm trying to add dropdowns dynamically using ng-repeat. The problem is that when any one dropdown is clicked it triggers all of them. I'm guessing I'm doing something really stupid with my code and I would appreciate it if someone could...

Unexpected outcome of ng-repeat

javascript,angularjs,angularjs-ng-repeat,ng-repeat
I need to create a graph for a voting app, see the image below. It works pretty well, but there is an unexpected behavior while crafting the bars with extended width and reduced opacity. They are calculated by the sum of each result within a "0-4" or "5 to 9"...

Binding radio buttons in an ng-repeat with angular

html,angularjs,binding,radio-button,ng-repeat
I'm relatively new to angular and i'm trying to bind my form radio buttons so I can post the data to the back end. My problem is when I try to submit the form, the variable formData doesn't contain any of the information entered in the form. I tried binding...

How to remove object from array within ng-repeat with AngularJS?

angularjs,ng-repeat
I am having an array with objects like [{...}, {...}] which I am outputting with ng-repeat. Then I have a delete button with a function to delete it. Is there a simple way to delete it in AngularJS, perhaps with $index? Or I need to specify an ID on every...

Ng-Repeat does not repeat (or return anything)

javascript,html,json,angularjs,ng-repeat
I am new to AngularJS and still playing around with it at this point. To teach myself the concepts, I am working off of a few hand-constructed JSON files. I first used it to construct the elements of a pop-out javascript menu by using ng-repeat on a list element where...

Need to repeat these objects within objects. Can I use $index with ng-repeat to make this happen?

javascript,angularjs,ng-repeat
I have the following javascript object called "tabs": http://i.imgur.com/hKTj9o9.png My desired output on page: section0.title children0.title children1.title which ends up being Analytical Balances ML XS I already have the tab names (tab0.title, tab1.title) repeating as tabbed navigation and am wondering how I might repeat the section names (e.g. section0.title) and...

angular: Why won't ng-repeat update with data from ajax call?

ajax,angularjs,ng-repeat
From a controller a do a ajax call. The call can be triggered from two different links, both in the same html template. When using the above link that switches to the tab the data returned by the ajax call is displayed correctly. When using the refresh link the element...

AngularJS tabs with ng-repeat

angularjs,tabs,ng-repeat
I asked this question before and was wondering maybe somebody has had a similar problem and maybe know how to deal with it? My plnkr! Angular tabs are not working with ng-repeat. It seems that Angular can't put together tab value from click and tab value from ng-show. My code:...

AngularJS - accessing a array of objects in a controller goes wrong

angularjs,ng-repeat
I'm trying to access an array of objects in my controller : angular.module('schoolManagement').controller('CycleController', ['$scope', function($scope){ $scope.cycles = [ { nomCycle : 'Primaire', active : 'oui' }, { nomCycle : 'Collège', active : 'non' } ]; console.log($scope.cycles[0].nomCycle); }]); The console.log() gives exactly what i'm looking for the in console, but...

AngularJS doesnt show json data

json,angularjs,ng-repeat
I've been trying out AngularJS by creating a simple gallery that gets images from a json file, but somehow I can't seem to display the data. index.html: <!DOCTYPE html> <html ng-app="portfolioApp"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script> <script src="app.js"></script> <link rel="stylesheet" href="style.css"> </head> <body> <div ng-controller="GalleryController" > <ul> <li ng-repeat="image in...

How to access a field on a ng-repeat generated table?

javascript,angularjs,table,ng-repeat
I'm new to AngularJS and have only been toying with it. I guess this must be an easy thing to do. I have a 3 column table generated with ng-repeat. Each row has a button which calls a function and i want to pass an argument to it, basically a...

Angular: ng-repeat depending on state of other object

javascript,angularjs,checkbox,ng-repeat
I'm having trouble figuring out how to use ng-repeat based on the state of objects in different arrays. Imagine my page displays 3 tables, populated using ng-repeat: A list of persons, with a checkbox thats checked based on an active field. A list of messages, showing only the messages for...

ng-repeat not bind ng-model array of objects

javascript,angularjs,ng-repeat
I'm try to bind array of objects to html. But when I changed input value, model not changed. What i'm doing wrong? Sorry, this is very simple case, but i'm confused. My html: <div ng-app="myApp" ng-controller="myCtrl"> <table class="price-table"> <tbody> <tr ng-repeat="item in prices track by $index"> <td><span>{{item.country_code}}</span></td> <td><input ng-value="prices[$index].price" ng-input="item.price...