EVOLUTION-MANAGER
Edit File: ngDisabled.html
<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ng/directive/attrs.js?message=docs(ngDisabled)%3A%20describe%20your%20change...#L154' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a> <a href='https://github.com/angular/angular.js/tree/v1.3.9/src/ng/directive/attrs.js#L154' class='view-source pull-right btn btn-primary'> <i class="glyphicon glyphicon-zoom-in"> </i>View Source </a> <header class="api-profile-header"> <h1 class="api-profile-header-heading">ngDisabled</h1> <ol class="api-profile-header-structure naked-list step-list"> <li> - directive in module <a href="api/ng">ng</a> </li> </ol> </header> <div class="api-profile-description"> <p>We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:</p> <pre><code class="lang-html"><div ng-init="scope = { isDisabled: false }"> <button disabled="{{scope.isDisabled}}">Disabled</button> </div> </code></pre> <p>The HTML specification does not require browsers to preserve the values of boolean attributes such as disabled. (Their presence means true and their absence means false.) If we put an Angular interpolation expression into such an attribute then the binding information would be lost when the browser removes the attribute. The <code>ngDisabled</code> directive solves this problem for the <code>disabled</code> attribute. This complementary directive is not removed by the browser and so provides a permanent reliable place to store the binding information.</p> </div> <div> <h2>Directive Info</h2> <ul> <li>This directive executes at priority level 100.</li> </ul> <h2 id="usage">Usage</h2> <div class="usage"> <ul> <li>as attribute: <pre><code><INPUT ng-disabled=""> ... </INPUT></code></pre> </li> </div> <section class="api-section"> <h3>Arguments</h3> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> ngDisabled </td> <td> <a href="" class="label type-hint type-hint-expression">expression</a> </td> <td> <p>If the <a href="guide/expression">expression</a> is truthy, then special attribute "disabled" will be set on the element</p> </td> </tr> </tbody> </table> </section> <h2 id="example">Example</h2><p> <div> <a ng-click="openPlunkr('examples/example-example53')" class="btn pull-right"> <i class="glyphicon glyphicon-edit"> </i> Edit in Plunker</a> <div class="runnable-example" path="examples/example-example53"> <div class="runnable-example-file" name="index.html" language="html" type="html"> <pre><code>Click me to toggle: <input type="checkbox" ng-model="checked"><br/> <button ng-model="button" ng-disabled="checked">Button</button></code></pre> </div> <div class="runnable-example-file" name="protractor.js" type="protractor" language="js"> <pre><code>it('should toggle button', function() { expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); element(by.model('checked')).click(); expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); });</code></pre> </div> <iframe class="runnable-example-frame" src="examples/example-example53/index.html" name="example-example53"></iframe> </div> </div> </p> </div>