Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

Here's a plunker: http://plnkr.co/edit/hJsZFCBZhFT5rRo1lgSZ?p=preview It's a simple directive that is supposed to show a given number of dots and highlight a subset of them based on the value, min, ...
drgould's user avatar
2 votes
1 answer
5k views

Hi, i'm trying to add a class to an element via ng-class. As you can see, the code is very simple but it doesn't add the class: app.run(function($rootScope, $location,$http,ngDialog,array_helper){ ...
Filippo oretti's user avatar
0 votes
0 answers
388 views

I'm building a multiple-choice question web app. There are 5 options for every question. Before a button is clicked it has a default button class: btn btn-default. At the moment I have it so that when ...
robertbabington's user avatar
22 votes
2 answers
26k views

You can use ng-animate with ng-class with the add and remove animations. I'm looking to make one animation in CSS3 but haven't found good examples with ng-class online. So I was wondering if people ...
NicolasMoise's user avatar
  • 7,279
0 votes
2 answers
848 views

I am new to AngularJS. I want to add a class to the second column based on it's value. Example: I want add the class 'positive' if the value is > 0 and class 'negative' when it is < 0. What I am ...
user1788175's user avatar
  • 1,518
1 vote
2 answers
335 views

I'm trying to write a mix of ternary and Boolean expression in the angular class (ng-class) directive. but I can't find the right syntax to make it work, or find a decent example on the web. I know ...
Erab BO's user avatar
  • 846
1 vote
0 answers
536 views

Angularjs 1.2.6 scenario: 2 inputs, 1 textbox (sounds kinda dirty). The inputs both trigger a show / hide transition on blur / focus events and focus always comes after blur if click from one input to ...
Benny Bottema's user avatar
1 vote
0 answers
611 views

I'm writing a Chrome extension using AngularJS. The UI is served via a browser action popup and as the content changes I sometimes need to change the size of the popup. The only way I've been able to ...
Abe Hendlish's user avatar
4 votes
4 answers
5k views

I have an array with classes set in the controller (has to be this way, it's read from page's meta-template). I'd also like to have a conditional classes applied to the same element. Is it possible? ...
muszek's user avatar
  • 447
98 votes
10 answers
355k views

I am trying to work how to add a class with ngClick. I have uploaded up my code onto plunker Click here. Looking at the angular documentation i can't figure out the exact way it should be done. Below ...
NewKidOnTheBlock's user avatar
1 vote
1 answer
247 views

I am trying to validate a form using AngularJS. This is my form: <form ng-controller="LoginCtrl" role="form" class="form-horizontal"> <div class="form-group"> <label for="...
Remco Haszing's user avatar
1 vote
1 answer
2k views

I'm having trouble grasping that when item.dynamicClass = 'article' why <div class="type" ng-class="{{ item.dynamicClass }}"> doesn't return a div like: <div class="type article"> but ...
Marius Miliunas's user avatar
0 votes
0 answers
119 views

I am trying to set a class to a button based on the value of the expression as follows ng-class="{disabled:((post_data.somearray.length==0) && (!post_data.message))} I am trying to check if ...
Neil's user avatar
  • 2,912
2 votes
2 answers
1k views

If I have: ng-class='{in:$first}' What is the simplest way to make it add the in class when $first is true or if let's say the item.in ($scope.item.in) value is true ? note: $first is because I have ...
Diolor's user avatar
  • 13.5k
0 votes
1 answer
58 views

My directive works perfectly in chrome but not in IE8: app.directive('barMax', function ($compile) { return { restrict: 'E', scope: { current: '=', max: '='...
user2756589's user avatar
5 votes
1 answer
9k views

I tried creating a directive: app.directive('barsCurrent', function () { return { restrict: 'E', link: function postLink(scope, element, attrs) { attrs.$observe('value'...
user2756589's user avatar
0 votes
1 answer
1k views

Here are the scripts and style that I used: <script src="angular.min.js"></script> <style> .greater { color:#D7E3BF; background-color:#D7E3BF; } .less { ...
user2756589's user avatar
7 votes
4 answers
61k views

I am new to Angular Js. I need to add a class to an element on its click event. I tried the following code. But it is not working. <html> <head> <style> .active{color:...
Sajith's user avatar
  • 2,852
3 votes
1 answer
787 views

I'm trying to attach js-defined animations to the ng-class directive via the usual syntax using add and remove but the animations won't run. Logging reveals that the add and remove functions don't get ...
Botteu's user avatar
  • 33
2 votes
2 answers
5k views

I would like to combine the directive progress from angular-ui, with the directive ngClass. So far I don't get any reactions at all. Am I doing this wrong, or is it not possible to combine? What I ...
user2591197's user avatar
5 votes
1 answer
2k views

I am trying to load a 'class' directive using ng-class. but my directive is never loaded when i do that. The directive is a multipurpose directive, and I don't want to create an isolated scope on this....
Vaibhav Pingle's user avatar
1 vote
1 answer
2k views

This is very straightforward but I am not able to change the class. I am basically verifying if the date is in correct format (DD-MMM-YYYY hh:mm:ss). <input type="text" style="width : 80%" ng-...
lostpacket's user avatar
  • 1,401
0 votes
1 answer
857 views

I am aware that in angular you can do something like this: <div ng-class="{myClassName: myCondition}"></div> and Angular will add 'myClassName' to the class attribute if the condition is ...
Walt's user avatar
  • 1,531
628 votes
12 answers
670k views

ALERT: This thread is for the old AngularJS! Can we have multiple expression to add multiple ng-class ? for eg. <div ng-class="{class1: expressionData1, class2: expressionData2}"></...
Aditya Sethi's user avatar
  • 10.6k
7 votes
1 answer
3k views

Tried looking for an answer to this with no success. Is there anyway to have the value of a property be the class name when using ng-class in angularJS? An example of what I mean: var things = [ ...
user1262360's user avatar
3 votes
2 answers
10k views

I want to use a loop to create my navigation Here is my code I keep getting an error saying it won't evaluate as a string? The code that I wrote is so that it will loop through the $scope.navigation ...
Jesse's user avatar
  • 835
0 votes
1 answer
273 views

I'm trying to use directive called ng-class to set multiply rules from CSS file. Here is a part of code <div class="filterToggleBtn thumbnail" ng-class="{ filterToggleBtnSide ...
Ivan Alienman's user avatar
265 votes
9 answers
571k views

With AngularJS I'm using ng-class the following way: <div class="bigIcon" data-ng-click="PickUp()" ng-class="{first:'classA', second:'classB', third:'classC', fourth:'classC'}[call.State]"/> I'...
Dor Cohen's user avatar
  • 17.1k
0 votes
1 answer
695 views

first of all sorry for my English. my problem is: i've this simple code: <li ng:repeat="item in menu.items" ng:class="getMenuItemClass(item)"> <a ng:href="#{{item.url}}">{{item.label}}&...
justBorn's user avatar
  • 113
0 votes
1 answer
3k views

is it possible to avoid repeating the code here by replacing the ng-switch by ng-class. <li ng-repeat="el in elm.required"> <span ng-switch on="el.type" > <i class="icon-...
François Romain's user avatar
0 votes
1 answer
1k views

Tried so many different ways and still can't figure this. I have a menu with ng-class="{menuVisibleAnimation: menuOpen}" in a template in a nested directive. When I click on the button in the parent ...
otissv's user avatar
  • 945
2 votes
1 answer
5k views

In the code below,i am having a variable in controller named "selectedDesignAreaId" and i bind this variable with the current value of "designarea.id",but when i change "selectedDesignAreaId" to any ...
SHIVANG SANGHI's user avatar
26 votes
1 answer
38k views

I have a textarea containing a message to be posted and a span with the number of characters still available. <textarea name="" cols="" rows="" maxLength="{{maxMessageLength}}" ng-model="...
Raibaz's user avatar
  • 9,740
41 votes
9 answers
58k views

I have an array of Person objects var persons = [ {Name:'John',Eligible:true}, {Name:'Mark',Eligible:true}, {Name:'Sam',Eligible:false}, {Name:'Edward',Eligible:false}, {Name:'Michael',Eligible:true} ...
I_Debug_Everything's user avatar
2 votes
2 answers
896 views

I'm trying to work out why this doesn't work: <a class="ng-click: loadSomeDatas();">Click here to load some datas</a> But this does: <a ng-click="loadSomeDatas()">Click here to ...
Ahmed Nuaman's user avatar
  • 13.4k
4 votes
2 answers
21k views

I am trying to use ng-class and bind a class to an expression so, that I can unit test the expression binding. But, it seems that I am missing something. The button: <li><a class="" ...
Adelin's user avatar
  • 19.2k
0 votes
2 answers
1k views

I have some very simple Angular code which looks like this... <div ng-repeat="message in data.messages" ng-class="'conversationCard-' + message.type"></div> It works, but the resulting ...
jonhobbs's user avatar
  • 28.2k
38 votes
5 answers
53k views

I have the component and have a problem setting the css class to it. I want it to always have a class of "box", then to have additional classes specified by the directive "class" argument and one ...
Szymon Wygnański's user avatar

1
15 16 17 18
19