-
Notifications
You must be signed in to change notification settings - Fork 248
feat(directives): Added two way databind for html5 contenteditable attri... #412
Conversation
Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement). CLA is important for us to be able to avoid legal troubles down the road. For individuals (a simple click-through form): http://code.google.com/legal/individual-cla-v1.0.html |
needs tests |
* `null`, it is treated as equivalent to the empty string for rendering | ||
* purposes. | ||
*/ | ||
@NgDirective(selector: '[contenteditable=true][ng-model]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
is not exactly right, see ContentEditable spec - it could also be empty or inherit
. You should probably check el.isContentEditable
in the code when the attribute is present whatever its value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vitor, you are right. I will check this later.
On Jan 18, 2014, at 6:47 AM, Victor Berchet notifications@github.com wrote:
In lib/directive/ng_model.dart:
@@ -325,3 +325,25 @@ class InputRadioDirective {
});
}
}
+
+/**
- * Usage (span could be replaced with any element like p):
- *
- * This creates a two way databinding between the expression specified in
- * ng-model and the html element in the DOM. If the ng-model value is
- *
null
, it is treated as equivalent to the empty string for rendering- * purposes.
- */
+@ngdirective(selector: '[contenteditable=true][ng-model]')
true is not exactly right, see ContentEditable spec - it could also be empty or inherit. You should probably check el.isContentEditable in the code when the attribute is present whatever its value.—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this to just say [contenteditable]
It looks like you still have not signed the CLA: http://code.google.com/legal/individual-cla-v1.0.html |
I see you signed it with a different email address. It breaks the automated system. :-) OK, will change the status manually. |
MERGED |
@mhevery what about my comment above, worth a fix PR ? |
Hi @vicb I'm working with that, it's a simple solution but the test architecture is beating me in the face :-) The tests now run but fail without good reason. Apparent the browser is not working as the spec says. Soon I will pull the code |
looking forward to the fix. |
Hi guys,
This is a simple implementation for data bind between html5 contentenditable atributes. First I find this thread in stack overflow: http://stackoverflow.com/questions/15108602/two-way-binding-of-contenteditable-item-inside-ng-list
It uses AngularJs.
My first try was translate the code in stack overflow to Dart. But after I read the code on _InputTextlikeDirective in the same file, I realize that it do more checks and make the same think, so I just override the get and set for the value be the innerHtml instead of value
I also open this thread for angular dart: http://stackoverflow.com/questions/21055252/how-to-enable-databind-in-contenteditable-on-angular-dart