Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(rating): plug into ngModel controller #1546

Closed
wants to merge 1 commit into from

Conversation

bekos
Copy link
Contributor

@bekos bekos commented Jan 8, 2014

No description provided.

$scope.value = value;
if ( !$scope.readonly ) {
ngModelCtrl.$setViewValue(value);
ngModelCtrl.$render();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if this call was necessary as render is called when viewValue differs from modelValue, and during mouseLeave, render is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about the $render called by the $setViewValue function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, you're right, I'm misreading everything tonight heh. Although it's unlikely that rate() can be called before enter() (mouseenter usually occurs before click). It's safer to have this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, 4-eyes principle :-)

@chrisirhc
Copy link
Contributor

I really like this change. 👍

BREAKING CHANGE: `rating` is now integrated with `ngModelController`.
 * `value` is replaced from `ng-model`.

  Before:

  <rating value="rate" ...></rating>

  After:

  <rating ng-model="rate" ...></rating>
@bekos bekos closed this in 47e227f Jan 13, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants