How can set text row limit using angularJs ng-repeat?
Tags: javascript,css,angularjs
Problem :
I have angularJs ng-repeat i want to set max row limit (3 rows) on ng-repeat because user can add multiple values using modal window so this div is increasing.
How can i achieve that task using angularJs or with css ?
main.html
<div class="orcitMultiSelectFieldValues" ng-show="selectedOwners.length" ng-click="openPrcsOwner()" ng-class="{'orcitMultiSelectFieldValues--disabled':!PROCESS_EDIT}">
<div class="orcitMultiSelectFieldTagList">
<div ng-repeat="selectedOwner in selectedOwners track by selectedOwner.workerKey" class="orcitMultiSelectTagItem">
<span>{{selectedOwner.fullName}}</span>
</div>
</div>
</div>
main.css
.orcitMultiSelectFieldTagList{
min-height: 34px;
background-color: #fff;
border: 1px solid #ccc;
padding: 0 0 4px 0;
cursor: text;
}
.orcitMultiSelectTagItem {
display: inline-block;
margin: 4px 0 0 7px;
background-color: #428bca;
color: #fff;
padding: 0 15px 0 5px;
font-size: 14px;
line-height: 24px;
cursor: default;
transition: box-shadow 100ms linear;
position: relative
}
.orcitMultiSelectTagItem:hover {
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
}
.orcitMultiSelectFieldValues--disabled .orcitMultiSelectFieldTagList {
background-color: #eee;
cursor: not-allowed;
}
Solution :
You can use limitTo to cap the number of rows -
<div ng-repeat="ng-repeat="selectedOwner in selectedOwners | limitTo:3 track by selectedOwner.workerKey"">
//stuff
</div>
CSS Howto..
You can use class binding like: @Component({ selector: '...', template: ` <div class="tab-change-login"> <ul class="un-styled tab-ul"> <li [class.tab-active]="activeTabName == 'signin-area'" data-login="signin-area" (click)="activeTabName = 'signin-area'">SIGN IN</li> <li...
Is this what you are looking for http://jsfiddle.net/DIRTY_SMITH/a0my545L/1/ I set the width of the <div> to 400px; then floated your text left with a margin left of 400px;...
If ancient browser support is not a problem, you can make use of css3 Flex property. apply display:flex; justify-content: space-around for the <ul> and remove float:left Here's a screenshot of...
Surely your .container moves to left because you set the position: fixed and it sticks to the very left site as designed. If you want to center the Bootstrap's .container...
:before is an pseudo element and cannot be accessed in the DOM. Instead have a span or div with those style and use it's click event. Note: Just make sure...
You could add padding to the li, and then use a negative text-indent value to displace the padding on the first line. jsFiddle example li { padding-left:30px; text-indent:-30px; } This...
If the image is inside the field try float:left; padding-left:5px; Hope I helped, or else paste your code at http://jsfiddle.net/...
Solved my own problem. This works like a charm! CSS #Content{ width:100%; min-height:100%; } jQuery $(document).ready(function () { var docHeight = $('#content').height(); var wantedHeight = docHeight - 376;/*Minus header and...
Too easy to change your input type button name use value attribute in tag i added a spinet this makes things clear for you. :) <form action="test" method="post" > <input...
The following base code will work for you, you can modify it to enable CSS animations etc. as necessary. p { // Put whatever height you want here, we're using...
Here's the JSFiddle for the effect you were going for: https://jsfiddle.net/d1xzc4jf/7/ Here's the relevant jQuery code: $(window).bind('mousewheel DOMMouseScroll', function(event){ if (event.originalEvent.wheelDelta > 0 || event.originalEvent.detail < 0) { console.log('scrolling down');...
That's easy! Just use radio buttons and targeted labels. Radio buttons have the (necessary) behavior of only allowing one to be selected at any one timeājust like an image in...
Do you mean something like this FIDDLE? JS var $dialogpopup = $( ".hiddenimagediv" ).dialog({ autoOpen: false, height: 'auto', width: 'auto', position: {my: "top middle", at: "top middle", of: ".imagediv"}, title:"Your...
You need a script which receives the posted information and some place to store the quotes. The script can be written in ASP.NET, PHP, python or whatever else your webserver...
Add this style (tested both on Chrome and Firefox) label { display: block; padding-left: 1.5em; text-indent: -.7em; } http://jsfiddle.net/tkt4zsmc/2/ Final result: ...
George's way will work. Another way is as follows: Same HTML as George except remove the <span>'s: <nav> <ul class="nav navbar-default"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li...
I found the answer: http://i.stack.imgur.com/POU1b.jpg Theses params was set by default at 60% so my fonts was 40% tinyer that it should be. Now 30px is a real 30px :)...
Add overflow:hidden for your dd elements (that keeps them from flowing underneath the floated dt), and remove the margin for li:first-child: http://jsfiddle.net/CBroe/E3QW2/3/...
Change link properties here: .nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover{ color: #fff; background-color: #337ab7; } Change logos under skill here: .skillslogo{ } EDIT: Note that if you want to have a different style...
Make the background color as transparent #masthead .color-site-white { background-color:rgba(255,255,255,.5); position:fixed; left: 0; right: 0; } #masthead .color-site-white:hover { background-color:rgba(255,255,255,1); } For IE 7, 8 - This will not support...
I would use table and table-cell too, with some tweaks as follows. #outer-box { display: table; width: 100%; white-space: nowrap; } #multiple-span, #input-auto-fit { display: table-cell; } #multiple-span span {...
As you are creating div with id #box, add the following css in the external css file and include it in the <head> #box { position: absolute; background: red; width:...
Do you have any suggestion on how to successfully seperate HTML/CSS from PHP/SQL? Congrats for looking how you can improve code. That's the precondition, you need to want to...
Here is a solution that closely resembles your sample image... Demo: http://jsfiddle.net/Zjnw9/1/ HTML... <div class="row"> <p class="q">This is a question?</p> <ul class="options"> <li><label>One</label><input type="radio" /></li>...
Style should be like this: .Pager a { color: #000000; text-decoration: none; } .Pager hover { color: #AAFF00; text-decoration: none; } .Pager { color: #885454; text-decoration: none; background-color: #FFF7E7;} ...
You might want to try adding units to that CSS: .yui-calendar { height:10px; width:10px; } You need units for values other than 0 in CSS....
You can change the textcolor by overriding md-menu-item. This will take some screwing around with since you'll probably need to !important certain classes to override material design. md-menu-content.md-default-theme md-menu-item, md-menu-content...
Its best that you use sass, and generate the css file like that. You can set a default font size (by only using 1 line) and the rest of the...
I received the answer in another thread - How to add 'if' to jQuery chain code use - .each(function() { this.style.cssText+= 'z-index: '+(parseInt($(this).css('z-index'))+1)+' !important'; }) but after struggling with the...
#div1 { } #div2 { opacity:0.5; } #div1:hover { opacity:0.6; position: relative; } #div:hover > :after { opacity: 0.5; position: absolute; height: ...; width: ..; } #div1:hover > div1 {...