angularjs-ng-repeat

AngularJS ng-repeat jQuery find returns only one element

泪湿孤枕 提交于 2020-01-03 05:37:27
问题 I am developing my first AngularJS app, and came across this problem with jQuery find function. Basically what I am trying to do, is that I have an custom HTML component . It contains list of buttons using ng-repeat directive. Each has it's own ng-click listener, and in it's callback I want to find all app-item elements, but sadly it only returns me the first one. I think this is the case I should use link , but I cannot come with it myself. Part of app-screen.html: <div> <div ng-repeat=

UIKit accordion and ng-repeat doesn't work

独自空忆成欢 提交于 2020-01-03 05:32:09
问题 I'm adding new accordion sections to my UIKit data-uk-accordion dynamically, using ng-repeat. <div class="uk-accordion" data-uk-accordion="{ collapse: false }"> <h3 class="uk-accordion-title uk-active" ng-repeat-start="driver in drivers">Driver {{driver.id}}</h3> <div class="uk-accordion-content" ng-repeat-end> ... </div> When I add new accordion sections and I click on the title to collapse, I'm getting the following error: TypeError: wrapper is undefined, on line 73 of accordion.js in UIkit

How do I add markers to a Google Map?

丶灬走出姿态 提交于 2020-01-02 20:08:33
问题 I am trying to have an input field that when submitted adds a marker to my Google Map. Right now when I submit the field it is creating the object but the marker is not being displayed. Right now I am able to get a location to show up if it is hard coded in but not when I add a new one. (I know that the view right now is only for the hard coded one, I have that so the current code is working) Here is my code: My View: <form> <input type="number" class="" ng-model="marker.markerLat" required="

accordion with ng-repeat and ng-bind-html won't work

陌路散爱 提交于 2020-01-02 16:55:08
问题 I'm trying to use accordion and html content in this way: <accordion> <accordion-group ng-repeat="item in items"> <accordion-heading> <a class="btn btn-primary btn-block btn-elenco"> <img postsrc="img/flag/flag_{{item.index}}.jpg"> </a> </accordion-heading> <p ng-bind-html="item.content"></p> </accordion-group> </accordion> AND var items = []; for(var i=0;i<10;i++){ var content = "<div>TEST</div>"; items.push({index:i,content:content}); } $scope.items = items; var app = angular.module('MyApp'

accordion with ng-repeat and ng-bind-html won't work

不羁的心 提交于 2020-01-02 16:55:06
问题 I'm trying to use accordion and html content in this way: <accordion> <accordion-group ng-repeat="item in items"> <accordion-heading> <a class="btn btn-primary btn-block btn-elenco"> <img postsrc="img/flag/flag_{{item.index}}.jpg"> </a> </accordion-heading> <p ng-bind-html="item.content"></p> </accordion-group> </accordion> AND var items = []; for(var i=0;i<10;i++){ var content = "<div>TEST</div>"; items.push({index:i,content:content}); } $scope.items = items; var app = angular.module('MyApp'

AngularJS ng-repeat setting default select value

依然范特西╮ 提交于 2020-01-02 08:22:53
问题 $scope.activities = [ { id: 1, type: "DROPDOWN_MENU", name: "Dropdown Menu" }, { id: 2, type: "HORIZONTAL_BAR", name: "Horizontal Bar" } ]; <select data-ng-model="engineer.currentActivity" data-ng-options="a.name for a in activities"> </select> Using the above I am able to create a select box with 3 values, a blank one and then dropdown menu and horizontal bar. I would like to set Horizontal Bar as my default and cannot see how to do this. Help would be great 回答1: In the controller, just add

AngularJS ng-repeat setting default select value

孤者浪人 提交于 2020-01-02 08:22:29
问题 $scope.activities = [ { id: 1, type: "DROPDOWN_MENU", name: "Dropdown Menu" }, { id: 2, type: "HORIZONTAL_BAR", name: "Horizontal Bar" } ]; <select data-ng-model="engineer.currentActivity" data-ng-options="a.name for a in activities"> </select> Using the above I am able to create a select box with 3 values, a blank one and then dropdown menu and horizontal bar. I would like to set Horizontal Bar as my default and cannot see how to do this. Help would be great 回答1: In the controller, just add

AngularJS ng-repeat setting default select value

时光怂恿深爱的人放手 提交于 2020-01-02 08:22:10
问题 $scope.activities = [ { id: 1, type: "DROPDOWN_MENU", name: "Dropdown Menu" }, { id: 2, type: "HORIZONTAL_BAR", name: "Horizontal Bar" } ]; <select data-ng-model="engineer.currentActivity" data-ng-options="a.name for a in activities"> </select> Using the above I am able to create a select box with 3 values, a blank one and then dropdown menu and horizontal bar. I would like to set Horizontal Bar as my default and cannot see how to do this. Help would be great 回答1: In the controller, just add

How to use Angular to create n printable pages?

坚强是说给别人听的谎言 提交于 2020-01-02 05:39:07
问题 Well, I've searched a bit and did not find anything similar. I want to know how can I use Angular to create printable content, jump to the end of the page and print more content. How can I force the content to always fit on a specific size, like a PDF? Do I need Angular to do this? If not HTML, can I iterate over PDF printable pages? Example: Suppose I'm a teacher and I've asked my students to send a 10 lines essays to a specific web system. Now, in the admin page, I want to print 10 students

Nested comments in AngularJS with ng-repeat

帅比萌擦擦* 提交于 2020-01-02 04:51:06
问题 I've created a directive for displaying nested comments in AngularJS. The main point of it was to have infinite comments when returned JSON from API would look something like this: [ { 'id': 66, 'text': 'This is the first comment.', 'creator': { 'id': 52, 'display_name': 'Ben' }, 'respondsto': null, 'created_at': '2014-08-14T13:19:59.751Z', 'responses': [ { 'id': 71, 'text': 'This is a response to the first comment.', 'creator': { 'id': 14, 'display_name': 'Daniel', }, 'respondsto': 66,