Search Posts

Category: angularjs-ng-repeat

Infdig Error when trying to mutate data

I have a central storage system set up for my Angular app. In a component, I “subscribe” to the data in the central storage system, and if the data doesn’t exist, I call it from the database – which then loads into the central storage system to propagate back to the component: data.service.js: angular.module(‘core’).factory(‘dataService’, function($http) { let properties = { globalData = {} } properties.subscribeTo = function(data) { return this.globalData[data]; } properties.loadData = function(data) { […]

Angular 1.4 – How to move logic for ng-click item from template to controller?

I am looking to modify some code to add more functionality to an ng-click event that is within an ng-repeat. The current code updates the selected property for the item in the list: <li ng-repeat=”value in facet.values ng-click=”value.selected = (value.selected == 0) ? 1 : 0; accountSearch()”> … </li> I’d like to update the selected property but also fire an event to our analytics provider: <li ng-repeat=”value in facet.values ng-click=”itemClicked(value)”> … </li> Then in my […]

angularjs ng-repeat SELECT ALL

I have two columns of checkboxes using ng-repeat, one called ‘Calc.’ and the other called ‘Calc. Final’. I have a button which I would like, when clicked, to match the selections of Calc. in Calc. Final. Function: function updateCalcFinal() { vm.desktop.comparables.comp.forEach(e => { e.calcFinal = e.calc; console.log([e.calcFinal, e.calc]); }); } HTML: <button class=”btn btn-sm btn-primary pull-right mt5 mb5″ ng-disabled=”deskCtrl.loading” ng-click=”deskCtrl.updateCalcFinal()”> <i class=”glyphicon glyphicon-ok”></i> &nbsp;&nbsp;Igualar Calc. </button> The above code is binding in the console.log but […]

Display models of text-angulars

I’m displaying two text-angular WYSIWYG fields in ng-repeat like so <div data-ng-repeat=”n in langInput.values” class=”sell__description-container”> <h2 class=”sell__heading-secondary”> Opis w jÄ™zyku: {{ n.selected }} </h2> <div text-angular=”text-angular” name=”htmlcontent_{{n.id}}_{{ n.selected }}” data-ng-model=”descriptionHtml[$index]” class=”sell__text-editor” required> </div> {{ descriptionHtml[$index] }} And just below field I’m showing its model and it’s working correctly. It shows text with all this tags which I chose in editor. But 200 lines below I have something like summary and I want to display this […]

AngularJS & Firebase – Get specific values from database

Sorry to bother you with this, I have thoroughly searched for this but I have been actively trying to resolve this for over 20hrs. Im about to abandon working with angularjs and firebase. Just cant get my head around it.. I am trying to add database values to the page from an array. Its working for other data but not this. My firebase database: I have included the freebets related code which is all good […]

Rowspan with AngularJs

I need some help with ng-repeat of angularJs. I’m trying to render a table using colspan with the following json: var json = { “actorActress”:[ { “name”:”Angelina Jolie”, “age”:45, “rowspan”:2 }, { “name”:”Brad Pitt”, “age”:48, “rowspan”:3 } ], “Films”:[ { “film”:”Mr & Mrs Smith”, “other_info”:”info1″ }, { “film”:”Tomb Raider”, “other_info”:”info2″ }, { “film”:”Troy”, “other_info”:”info1″ }, { “film”:”Mr & Mrs Smith”, “other_info”:”info2″ }, { “film”:”Fight Club”, “other_info”:”info1″ } ] } And this is the table that […]

Not able to get selected radio button value in AngularJs

I am working on AngularJs(1.x) I have dynamically created radio buttons. There is a “submit” button below the radio buttons which sends the selected value to the backend. But problem is, I always get “undefined” as selected radio button value in my controller. Could you please tell me where I am going wrong? Below is my HTML code: <table> <tr ng-repeat=”detail in details”> <td><input type=”radio” name=”userinputs” ng-model=”selectedValues[detail.path]” /></td> <td class=”text”>{{detail.created_time}}</td> <td class=”text”>{{detail.path}}</td> </tr> </table> <button […]

Duplicate Key in Repeater Error [ngRepeat:dupes]

I’m guessing I’m getting an imaging error. I not sure of the source of the mistake. Note: Sometimes work smoothly, I often encounter this error. Form: <div class=”wrapper” ng-app=’afApp’ ng-controller=’afController’ style=”background: #F8F8F8;padding-top: 10px;”> <div class=”container-fluid”> <div class=”row”> <input type=”search” size=”40″ ng-model=”search” id=”search” autofocus=”autofocus” autocomplete=”off”> <section ng-repeat=”afData in afLoad | filter:search | limitTo:10″ ng-show=’search’ md-highlight-text=”search”> <div class=”row”> <div class=”col-sm-6 text-center”> <h2>{{afData.yil}}</h2> <h3>{{afData.sik1}}</h3> </div> <div class=”col-sm-6″> <p>{{afData.soru}}</p> </div> </div> </section> </div> </div> </div> Console [Browser]: Error: [ngRepeat:dupes] […]

angularjs: accessing scope outside of ng-repeat

I have a link within a table that toggles open an accordion to reveal more details: <div class=”table-cell”> <a class=”flex collapsed” ng-class=”{‘accordion-toggle collapsed’:x.campaign.length>0}” ng-if=”x.campaign.length>0″ data-toggle=”collapse” href=”#{{x.sys_id}}” role=”button” aria-expanded=”false” aria-controls=”collapseDetails”></a> </div> Because this is within a table, I have to close the div in order for the additional details to appear in a new row, but this will stop giving me access to the scope of my ng-repeat. My current accordion code looks like this: <div […]

How to loop through array of objects in angularjs

I have an object like this: { “batman”:[{“applicantSkillID”:”htl2″,”rating”:3,”applicantInterviewerID”:”usr1″,”applicantInterviewerName”:”batman”,”applicantSkillName”:”HTML”}, {“applicantSkillID”:”cs43″,”rating”:5,”applicantInterviewerID”:”usr1″,”applicantInterviewerName”:”batman”,”applicantSkillName”:”css”}], “Superman”:[{“applicantSkillID”:”ht12″,”rating”:3,”applicantInterviewerID”:”usr2″,”applicantInterviewerName”:”Superman”,”applicantSkillName”:”HTML”}, {“applicantSkillID”:”cs43″,”rating”:3,”applicantInterviewerID”:”usr2″,”applicantInterviewerName”:”Superman”,”applicantSkillName”:”css”}] } Now I am trying to display data applicantInterviewerName wise (Batman’s rating, Superman’s rating etc..) for only one applicantInterviewerName i can able to do it by taking the first object index like this: <tbody class=”table text-left boxShade displayTable”> <tr ng-repeat=”feedBack in c.data.interviewerFeedback”> <td class=”skillName” id=”{{feedBack.applicantSkillID}}”> {{feedBack.applicantSkillName}}</td> <td> <div class=”inputRangeDiv”> <input class=”inputRangeInputSlilder” ng-init=”skillScoreForm.skill[feedBack.applicantSkillID] = feedBack.rating” ng-model=”skillScoreForm.skill[feedBack.applicantSkillID]” value=”0″ oninput=”skillOutput.value = skillInput.value” id=’skillInput’ type=”range” min=”0″ max=”5″ ng-disabled=”true” […]

Next Page »