From acfe03a02ccab1ad430651c9346548b3b3d65a80 Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 11 Jul 2013 15:31:58 +0200 Subject: [PATCH] Added boValue. fixes #7 --- README.md | 1 + bindonce.js | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3a836c1..6550a0d 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ when used with `ng-repeat` `bindonce` doesn't need to check if `person` is defin | `bo-title = "text"` | evaluates "text" and render it as `title` for the element |``| | `bo-id = "text"` | evaluates "text" and render it as `id` for the element |``| | `bo-style = "text"` | evaluates "text" and render it as `style` for the element |``| +| `bo-value = "text"` | evaluates "text" and render it as `value` for the element |``| ## Todo Examples and Tests diff --git a/bindonce.js b/bindonce.js index 4d055d6..7708548 100644 --- a/bindonce.js +++ b/bindonce.js @@ -112,7 +112,8 @@ case 'title': case 'id': case 'style': - binder.element.attr(binder.attr, value); + case 'value': + binder.element.attr(binder.attr, value); break; } } @@ -150,9 +151,10 @@ angular.forEach({ 'boAlt' : 'alt', 'boTitle' : 'title', 'boId' : 'id', - 'boStyle' : 'style' -}, -function(tag, attribute) + 'boStyle' : 'style', + 'boValue' : 'value' +}, +function(tag, attribute) { var childPriority = 200; return angular.module('pasvaz.bindonce').directive(attribute, function()