Questions tagged [angularjs-ng-disabled]

This directive sets the disabled attribute on the element if the expression inside ngDisabled evaluates to truthy. The attribute is `disabled` with a `d`.

Spelling Note: The attribute is disabled; the directive is ng-disabled;
Both include the letter d at the end.

A special directive is necessary because we cannot use interpolation inside the disabled attribute.

Erroneous

<div ng-init="isDisabled = false">
    <button disabled="{{isDisabled}}">Disabled</button>
</div>

Use instead:

<div ng-init="isDisabled = false">
    <button ng-disabled="isDisabled">Disabled</button>
</div>

Resources

93 questions
0
votes
1 answer

ng-disabled button until input file is changed

I have a form and it includes an input file for uploading photos. What I want is to disable the button until input file has no value. I also have other validations that make the button disabled. My html file is like this
bleyk
  • 799
  • 3
  • 14
  • 41
0
votes
2 answers

AngularJS : Does ng-disabled remove input value?

The title says everything... I've been reading several posts on Stackoverflow as well as the documentation, but I haven't found a satisfactory explanation yet. If ng-disabled is activated, is the input value inside the tag removed? Let me illustrate…
Hiroki
  • 3,893
  • 13
  • 51
  • 90
0
votes
1 answer

angularjs dynamic add option field with disable previous selected option

Hi I am adding Dynamically form fields like this
Ritha
  • 89
  • 1
  • 1
  • 10
0
votes
1 answer

Microsoft Edge - Disabled link is clickable

I have an angular anchor tag in my page, and when it is disable it's still clickable in the Microsoft Edge browser. Link a[disabled] { pointer-events: none; } How do I solve this?
RCM
  • 91
  • 3
  • 10
0
votes
2 answers

Create angular directive like ngDisabled to check roles in list

I want to create an attribute directive like ngDisabled to enable or disable elements if some specific role is present on my service. angular.module(...) .service('RolesSerivce', function() { this.hasRole = function(roleName) { return…
Beto Neto
  • 3,962
  • 7
  • 47
  • 81
0
votes
0 answers

AngularJS ng-disabled firing two alerts

I have a very simple html page which I'm using a bit of Angular JS. Each field has it's enable/disable roll. On the especific field INCLUIR SEGURO, I call a method called ValidaIncluirSeguro which is the root of my problem. This method validades the…
0
votes
1 answer

Ng-disabled not reacting on changes in value

I'm trying to disable submit button while some async call is in progress, but it looks like ng-disabled isn't watching for value change. Here is the code sample: Markup:
0
votes
1 answer

Enable the Button when any checkbox checked in the loop, Out Side Button

Enable the Button only when any checkbox checked in the loop, the button is out side the loop HTML
Snopzer
  • 1,602
  • 19
  • 31
0
votes
0 answers

How can optimize the expressions passed to ng-disabled directive on angularJS?

I have the following expression wrapped into a scope function to disable the add button in view using angularJS ng-disabled directive : $scope.disableAddButton = function() { return (!(currentObjCopy.name || currentObjCopy.name.trim() ||…
0
votes
2 answers

enable and disable buttons according to current date pass in angularjs

i have to make week schedular and i want to disable the buttons according to date i.e if today date pass then previous buttons see image: here html code: