Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngIf): don't create multiple elements when changing from a truthy… #4915

Closed
wants to merge 1 commit into from
Closed

Conversation

ulfryk
Copy link

@ulfryk ulfryk commented Nov 12, 2013

… to another thruthy value.

(another way of fixing it)

Fixes #4852.

… to another thruthy value.

(another way of fixing it)

Fixes #4852.
if (!childScope) {
$scope.$watch(
function ngIfWatchExpression() {
return toBoolean($parse($attr.ngIf)($scope));
Copy link
Contributor

Choose a reason for hiding this comment

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

$scope.$eval() will pretty much do this for you, but is it really important to re-$parse every $digest? that seems a bit like overkill since the expression is unlikely to change

Copy link
Author

Choose a reason for hiding this comment

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

It's just another suggestion, first (and better I think) is here:
#4911

@ulfryk ulfryk closed this Nov 12, 2013
@ulfryk ulfryk deleted the another branch November 13, 2013 06:59
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.

ngIf repeats itself instead of updating itself in 1.2.0
2 participants