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

Isolated scope property for directive is being re-digested in version 1.4.1 #12144

Closed
kikhtenko opened this issue Jun 17, 2015 · 18 comments
Closed

Comments

@kikhtenko
Copy link

Hi,

the issue is not reproducible in 1.4.0 and appears only in 1.4.1 as you can see in the link below
http://plnkr.co/edit/kbIJflj4sL5kcCcYPzw7?p=preview

The problem is when scope property is changed in directive's controller then in the next digest cycle it's being rewritten.

Regards,
Andrew
@kikhtenko

@Nickproger
Copy link

+1

3 similar comments
@vovashevchenko
Copy link

+1

@soutlan
Copy link

soutlan commented Jun 17, 2015

+1

@pbiryukov
Copy link

+1

@gkalpak
Copy link
Member

gkalpak commented Jun 17, 2015

It's probably a6339d3.

@Narretz
Copy link
Contributor

Narretz commented Jun 17, 2015

Probably. Also doesn't happen with =

@asadovnikov
Copy link

+1

@petebacondarwin
Copy link
Member

This issues is reopened as the fix was reverted.

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

@petebacondarwin missing a link/reason for the revert

@Narretz
Copy link
Contributor

Narretz commented Jul 7, 2015

@caitp #12259

(If material relied on buggy behavior, we should fix it there rather than in core)

@gkalpak
Copy link
Member

gkalpak commented Jul 7, 2015

+1 @Narretz
It seems quite bizarre that we reverted a fix to a (rather serious imo) bug/regression, because the fix broke an external module.

Is anyone looking into why ngMaterial broke with the fix ?

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

I was looking into it earlier, but I can't get any tests to fail when the angular module has the revert reverted, and i couldn't find any demos that behaved weirdly (under tabs or autocomplete)

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

I'm not actually sure where the material tests are, because the file in the test directory just has a bunch of matchers, no tests

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

nvm, found em :> there's a ddescribe() in there preventing tests from running, sending pr

@petebacondarwin
Copy link
Member

Thanks for looking into this everyone. I agree if material relied on buggy behaviour then it should be fixed there.

@petebacondarwin
Copy link
Member

But since angular-material is a first class citizen of the Angular team then we ought to have a process in place to run angular-material tests before we do a release.

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

The main problem I'm seeing is that they're using =? isolate scope bindings to represent boolean attributes, which doesn't make a lot of sense. It doesn't die in the reverted version because the reverted version ignores expressions valued at the empty string, if they're optional (which we can probably still do)

@caitp
Copy link
Contributor

caitp commented Jul 7, 2015

All of the angular-material tests pass for me (with the revert reverted) with the following change:

           case '=':
             if (!hasOwnProperty.call(attrs, attrName)) {
               if (optional) break;
               attrs[attrName] = void 0;
             }
+            if (optional && isString(attrs[attrName]) && !attrs[attrName].trim()) {
+              break;
+            }

I don't know if there are still other problems, but if there are, they aren't causing test failures (there are 2 disabled tests in the tree still)

caitp added a commit to caitp/angular.js that referenced this issue Jul 7, 2015
Previously, optional empty '='-bound expressions were ignored ---
erroneously they stopped being ignored, and no tests were caused to
fail for this reason. This change restores the original ignoring
behaviour while still preventing other errors fixed by 8a1eb16

Closes angular#12144
Closes angular#12259
caitp added a commit to caitp/angular.js that referenced this issue Jul 7, 2015
Previously, optional empty '='-bound expressions were ignored ---
erroneously they stopped being ignored, and no tests were caused to
fail for this reason. This change restores the original ignoring
behaviour while still preventing other errors fixed by 8a1eb16

Closes angular#12144
Closes angular#12259
@matsko matsko modified the milestones: 1.4.3, 1.4.4 Jul 14, 2015
@caitp caitp closed this as completed in 533d9b7 Jul 29, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
…esent

Shadows only when attributes are non-optional and not own properties,
only stores the observed '@' values when they are indeed strings.

Partial revert of 6339d30d1379689da5eec9647a953f64821f8b0

Closes angular#12151
Closes angular#12144
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
Previously, optional empty '='-bound expressions were ignored ---
erroneously they stopped being ignored, and no tests were caused to
fail for this reason. This change restores the original ignoring
behaviour while still preventing other errors fixed by 8a1eb16

Closes angular#12144
Closes angular#12259
Closes angular#12290
ggershoni pushed a commit to ggershoni/angular.js that referenced this issue Sep 29, 2015
Previously, optional empty '='-bound expressions were ignored ---
erroneously they stopped being ignored, and no tests were caused to
fail for this reason. This change restores the original ignoring
behaviour while still preventing other errors fixed by 8a1eb16

Closes angular#12144
Closes angular#12259
Closes angular#12290
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.