diff options
| author | David Chang | 2013-01-17 20:08:27 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2013-01-18 21:16:16 -0800 | 
| commit | b8bd4d5460d9952e9a3bb14992636b17859bd457 (patch) | |
| tree | 006bc10c402613a5a11c326e3d94b13037e0cd96 /src/ng/directive/booleanAttrs.js | |
| parent | b2f46251aca76c8568ee7d4bab54edbc9d7a186a (diff) | |
| download | angular.js-b8bd4d5460d9952e9a3bb14992636b17859bd457.tar.bz2 | |
feat(directive): added ng-open boolean directive
Closes# 1797 add ng-open attribute
Diffstat (limited to 'src/ng/directive/booleanAttrs.js')
| -rw-r--r-- | src/ng/directive/booleanAttrs.js | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js index 8902c35d..864c12c1 100644 --- a/src/ng/directive/booleanAttrs.js +++ b/src/ng/directive/booleanAttrs.js @@ -272,6 +272,37 @@   * @param {string} expression Angular expression that will be evaluated.   */ +/** + * @ngdoc directive + * @name ng.directive:ngOpen + * @restrict A + * + * @description + * The HTML specs do not require browsers to preserve the special attributes such as open. + * (The presence of them means true and absence means false) + * This prevents the angular compiler from correctly retrieving the binding expression. + * To solve this problem, we introduce the `ngMultiple` directive. + * + * @example +     <doc:example> +       <doc:source> +         Check me check multiple: <input type="checkbox" ng-model="open"><br/> +         <details id="details" ng-open="open"> +            <summary>Show/Hide me</summary> +         </details> +       </doc:source> +       <doc:scenario> +         it('should toggle open', function() { +           expect(element('#details').prop('open')).toBeFalsy(); +           input('open').check(); +           expect(element('#details').prop('open')).toBeTruthy(); +         }); +       </doc:scenario> +     </doc:example> + * + * @element DETAILS + * @param {string} expression Angular expression that will be evaluated. + */  var ngAttributeAliasDirectives = {}; | 
