angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

ng-enabled

Open cricardol opened this issue 14 years ago • 106 comments

Should this attribute be created in a future release?

cricardol avatar Aug 10 '12 14:08 cricardol

what is the rationalization?

On Fri, Aug 10, 2012 at 7:01 AM, cric [email protected] wrote:

Should this attribute be created in a future release?

— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.js/issues/1252.

mhevery avatar Aug 10 '12 14:08 mhevery

You need to use ng-disabled - there is no HTML attribute called enabled.

andershessellund avatar Aug 13 '12 13:08 andershessellund

It should be added for completeness...

Why have both ng-show and ng-hide when you can just use ng-hide?

It sometimes reads better, just like the show/hide variants, by avoiding double negatives: <button ng-enabled='loaded && product.available'/>

Vs: <button ng-disabled='!(loaded && product.available)'/>

adz avatar Mar 22 '13 04:03 adz

+1

pierredewilde avatar Mar 30 '13 12:03 pierredewilde

+1

I have a function in this attribute. It confused the hell of me that I need to return true to disable the button.

graphnode avatar Apr 10 '13 14:04 graphnode

+1

perrygovier avatar May 08 '13 01:05 perrygovier

+1

rzschech avatar Jun 03 '13 15:06 rzschech

as @adz said, like ng-show and ng-hide

wokier avatar Jun 17 '13 14:06 wokier

+1 as it makes for better readability - an ng-enabled would eliminate double negatives

shangxiao avatar Aug 01 '13 09:08 shangxiao

+1 :+1:

bevacqua avatar Aug 03 '13 20:08 bevacqua

+1 as well. I spent a few minutes today wondering why my ng-enabled="blah" directive wasn't working before I realized that there wasn't one.

mmastrac avatar Aug 06 '13 22:08 mmastrac

:+1:

devmondo avatar Aug 06 '13 22:08 devmondo

+1 Come on guys, you can make it

pencilcheck avatar Aug 14 '13 06:08 pencilcheck

+1 for intuitiveness, lower barrier to entry

basarat avatar Aug 16 '13 03:08 basarat

+1 double negatives are harder to think about and easier to screw up

glyphobet avatar Aug 22 '13 13:08 glyphobet

+1 if you have ng-hide and ng-show you should also have ng-enabled

kdekooter avatar Sep 05 '13 15:09 kdekooter

+1

stanonyime avatar Sep 14 '13 10:09 stanonyime

+1

zdennis avatar Sep 16 '13 17:09 zdennis

+1

mariusschulz avatar Sep 17 '13 11:09 mariusschulz

+1

kanetz avatar Sep 18 '13 02:09 kanetz