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

One Way scope binding ('@') is behaving differently since 1.4.1 #12395

Closed
phouri opened this issue Jul 21, 2015 · 1 comment
Closed

One Way scope binding ('@') is behaving differently since 1.4.1 #12395

phouri opened this issue Jul 21, 2015 · 1 comment

Comments

@phouri
Copy link

phouri commented Jul 21, 2015

We recently upgraded to angular 1.4.3 from 1.3.15, (however this bug is when jumping from 1.4.0 to 1.4.1).

I have a scope defined in a directive:

 scope: {
                ngModel: '=',
                mode: '@',
                overallStart: '='
            }

and inside the link function:

 if (!$scope.mode) {
                    $scope.mode = 'daterange';
   }

And in the HTML:
ng-if="mode === 'daterange'"

Everything used to work well, but when changing from 1.4.0 to 1.4.1 I am getting that $scope.mode is undefined, when debugging I see that $scope.mode = 'daterange' is executed, but if I setup a watch on $scope.mode, it's always undefined.

I tried going through the breaking changes, but didn't see anything that reminded of that.

Working: http://plnkr.co/edit/nBXcEzRxpw0lKQvUEc3Q?p=preview
Not working: http://plnkr.co/edit/akSRZw5stA8OdzsLQv8V?p=preview

Did I miss anything in the release notes?

@phouri phouri changed the title BUG: @ scope binding is behaving differently One Way scope binding ('@') is behaving differently since 1.4.1 Jul 21, 2015
@Narretz
Copy link
Contributor

Narretz commented Jul 23, 2015

I think this a duplicate of a known bug that is scheduled to be fixed in 1.4.4 or 1.4.5: #12290

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants