diff options
| author | Misko Hevery | 2010-11-12 15:16:33 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2010-11-15 10:04:17 -0800 | 
| commit | 7e6f9992216157a10a64a86fe526f61f9f57e43f (patch) | |
| tree | e172da3909e44e8eb9a80eb86880fbb9cd814290 /src/directives.js | |
| parent | 625cc7609cfd1a0a4fcecfd55875e548518a72a8 (diff) | |
| download | angular.js-7e6f9992216157a10a64a86fe526f61f9f57e43f.tar.bz2 | |
added remaining directives and search box.
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 18 | 
1 files changed, 16 insertions, 2 deletions
diff --git a/src/directives.js b/src/directives.js index 50901cbe..e359d6cc 100644 --- a/src/directives.js +++ b/src/directives.js @@ -155,7 +155,7 @@ angularDirective("ng:eval", function(expression){   * HTML element with the value of the given expression and kept it up to    * date when the expression's value changes. Usually you just write    * {{expression}} and let <angular/> compile it into  - * <span ng:bind="expression"></span> at bootstrap time. + * `<span ng:bind="expression"></span>` at bootstrap time.   *    * @element ANY   * @param {expression} expression to eval. @@ -649,6 +649,7 @@ angularDirective("ng:submit", function(expression, element) {       expect(using('.doc-example-live').binding('counter')).toBe('3');     });   */ +//TODO: delete me, since having watch in UI is logic in UI. (leftover form getangular)  angularDirective("ng:watch", function(expression, element){    return function(element){      var self = this; @@ -862,15 +863,28 @@ angularDirective("ng:hide", function(expression, element){   * @name angular.directive.ng:style   *   * @description + * The ng:style allows you to set CSS style on an HTML element conditionally.   *    * @element ANY - * @param {expression} expression to eval. + * @param {expression} expression which evals to an object whes key's are  + *        CSS style names and values are coresponding values for those  + *        CSS keys.   *   * @exampleDescription   * @example +    <input type="button" value="set" ng:click="myStyle={color:'red'}"> +    <input type="button" value="clear" ng:click="myStyle={}"> +    <br/> +    <span ng:style="myStyle">Sample Text</span> +    <pre>myStyle={{myStyle}}</pre>   *    * @scenario     it('should check ng:style', function(){ +     expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); +     element('.doc-example-live :button[value=set]').click(); +     expect(element('.doc-example-live span').css('color')).toBe('red'); +     element('.doc-example-live :button[value=clear]').click(); +     expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)');     });   */  angularDirective("ng:style", function(expression, element){  | 
