Linked Questions

1 vote
1 answer
9k views

Is it possible to use ternary operator in ng-init in AngularJS ? Something like : <select ng-model="project" name="act" ng-options="act.user_id as act.user_display_name for act in actors" ng-init="...
Steffi's user avatar
  • 7,123
0 votes
1 answer
2k views

I know I can use ng-if to do conditionals like this: td.icon(ng-if="isAuthor()", colspan="2") td.icon(ng-if="!isAuthor()", colspan="3") But it seems a bit over-wordy for something simple. Is ...
Harry's user avatar
  • 55.4k
152 votes
9 answers
129k views

In angularjs you have the tag ng-src which has the purpose that you won't receive an error for an invalid url before angularjs gets to evaluate the variables placed in between {{ and }}. The problem ...
Jasper Schulte's user avatar
71 votes
3 answers
162k views

I have an angular template which looks like this... <div ng-repeat="message in data.messages" ng-class="message.type"> <div class="info"> <div class="type"></div> ...
jonhobbs's user avatar
  • 28.2k
94 votes
2 answers
125k views

My AngularJS template contains some custom HTML syntax like: <su-label tooltip="{{field.su_documentation}}">{{field.su_name}}</su-label> I created a directive to process it: .directive('...
Ismael Ghalimi's user avatar
33 votes
3 answers
52k views

Is there any way to write logic inline in a template in AngularJS. What I want to do is something like this: <div ng-repeat="item in items"> {{item.isValid ? 'Valid item' : 'Invalid Item'}}...
Seb Nilsson's user avatar
  • 26.5k
15 votes
2 answers
32k views

I have an ng-repeat li elements and I want to set a specific value for that li depending on whether a function returns true or false and I don't want to do it in the controller because I have ...
Georgi Angelov's user avatar
4 votes
4 answers
5k views

Is it possible inside ?: change dictionary and return this dictionary in the same block. Something like this a > b ? <dict['c'] = 'I'm changed', return dict> : <some other code>; I ...
silent_coder's user avatar
  • 6,572
1 vote
1 answer
1k views

I am working on the angular bootstrapUI accordion, I need to catch the toggle event for each section, for example, in each header of section, I have a arrow, when it is open the arrow-down will show,...
linyuanxie's user avatar
1 vote
1 answer
2k views

Got error with ng-style. Doesn't Angular allow ternary operator? I saw a SO post that shows Angular does support ternary operator, but not sure why it doesn't work for me. Error: [$parse:syntax] ...
packetie's user avatar
  • 5,107
1 vote
1 answer
1k views

Having searched extensively, got some help from A ternary in templates and getting partially functional results, I'm 99% sure I'm doing it 99% right, but...obviously not completely, so I'm here. The ...
LouisK's user avatar
  • 1,196
0 votes
2 answers
863 views

This is a newbie question. On the AngularJS site, there is a link to download AngularJS. The download button says "1.0.8/1.2.0-rc.2". I'm confused. Which version of AngularJS am I downloading? The ...
Node Newbie's user avatar
  • 1,971
1 vote
1 answer
460 views

I tried this, but it doesn't work: {{!filterNameVar ? valueVar : valueVar | filterNameVar}} I need it for my dataGrid, if I get a filterName from dataGrid settings for a column I should apply it. I ...
MaxNevermind's user avatar
  • 2,933
0 votes
1 answer
428 views

I am using a very simple code to bind the user text input to the model. The text box prompts the user to enter the name & says hello "username" on enter. But I also want Hello to appear only when ...
techPackets's user avatar
  • 4,514
0 votes
2 answers
71 views

I have a simple repeater setup like so <ion-item ng-repeat="location in data.posts"> {{location.title}} </ion-item> And of course for every array I get a title inside an ion-item. Now ...
Jacksonkr's user avatar
  • 32.3k

15 30 50 per page