-
Notifications
You must be signed in to change notification settings - Fork 248
feat(ng-model-options) Added ng-model-options #974
Conversation
Add support for the debounce part of ng-model-options
_expression = attrs["ng-model"]; | ||
print("model: " + _expression); |
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.
debug
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.
sorry will remove that.
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 |
I have started to add some comments in the PR. Some of them are repeated items, please check all changed lines where applicable. Please also follow the guidelines in /CONTRIBUTE.md for commit messages - it should also include "closes #969". Thanks for your work! |
Have signed the CLA |
Added support for the debounce part of ng-model-options closes #969
Think I have done everything asked if there is anything else let me know and I will fix ASAP, sorry for any problems it is my first time contributing to this project. Would you provide an eta when this would be released, as I have added this as i require it in a project I am working on. |
@@ -43,10 +43,9 @@ class NgModel extends NgControl implements AttachAware { | |||
Watch _watch; | |||
bool _watchCollection; | |||
|
|||
NgModel(this._scope, NgElement element, Injector injector, NodeAttrs attrs, | |||
NgModel(this._scope, NgElement element, Injector injector, NodeAttrs attrs, |
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.
extra white space
Thanks for fixing most of the first batch of comments, I've added some more. Please squash your commits and force push once you're done |
@@ -45,7 +45,7 @@ class NgModel extends NgControl implements AttachAware { | |||
|
|||
NgModel(this._scope, NgElement element, Injector injector, NodeAttrs attrs, | |||
Animate animate) | |||
: super(element, injector, animate) | |||
: super(element, injector, animate) |
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.
you should configure your editor to remove trailing ws
final Scope scope; | ||
NgBindTypeForDateLike ngBindType; | ||
|
||
InputDateLike(dom.Element this.inputElement, this.ngModel, this.scope, | ||
this.ngBindType) { | ||
InputDateLike(dom.Element this.inputElement, this.ngModel, this.scope, this.ngBindType, this.ngModelOptions) { |
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.
too long
Achievement unlocked: CLA signature found! |
func(); | ||
} | ||
else{ | ||
setTimer(new async.Timer(new Duration(milliseconds: delay), func)); |
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.
what about dropping the 3rd args & returning the timer
void _runFuncDebounced(int delay, func(), setTimer(async.Timer timer), async.Timer timer){ | ||
if (timer != null && timer.isActive) timer.cancel(); | ||
|
||
if(delay == 0){ |
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.
if () {
} else {
}
notice ws & formatting
Think thats all of them |
Will remember all of this for when I do future additions to reduce all of these issues. |
@@ -196,7 +195,7 @@ class NgModel extends NgControl implements AttachAware { | |||
|
|||
get viewValue => _viewValue; | |||
void set viewValue(value) { | |||
_viewValue = value; | |||
_viewValue = 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.
revert
Do you think you can come with a unit test ? |
Once this is merged how long untill it will be released? Will sort all of the test stuff out tommorow. |
Sorry I don't have the release planning in mind. Before it is released, you can point your dependency to a branch (master) or a SHA1. |
@@ -0,0 +1,62 @@ | |||
part of angular.directive; | |||
|
|||
@Decorator(selector: 'input[ng-model-options]') |
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.
Some doc about the purpose of this class would be great!
Added support for the debounce part of ng-model-options Closes dart-archive#969 Closes dart-archive#974
Added support for the debounce part of ng-model-options Closes dart-archive#969 Closes dart-archive#974
Added support for the debounce part of ng-model-options Closes dart-archive#969 Closes dart-archive#974
Add support for the debounce part of ng-model-options