-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-tooltip's md-visible causes $compile:nonassign on mouse wheel scrolling #9822
Comments
@smithgt it's throwing the error in this case, because you have a comparison operator in |
@crisbeto the weird thing is that it is only throwing on mouse wheel move, not on other methods of scrolling. The provided codepen is a super simplified case to demonstrate the inconsistent throwing of the error. My use case is that I have a Since I want a tooltip on the clickable md-list-item I tried the The only way I've been able to figure out how to use |
Sorry for the delayed response @smithgt. I took another look at it and what's even weirder is that we have the |
I'll close this since it's not the proper way of using two-way bindings. @smithgt if your app is using Angular >= 1.5, you can work around this by decorating the tooltip to use a one-way binding. You need to throw this somewhere in your code: angular.module('ngMaterial').config(['$provide', function($provide){
$provide.decorator('mdTooltipDirective', ['$delegate', function($delegate) {
$delegate[0].scope.visible = '<?mdVisible';
return $delegate;
}]);
}]); We can't apply this directly to Material, because we still support down to Angular 1.3. Let me know if this does the trick. |
@crisbeto That works well. Thanks! |
@crisbeto - nice! |
@crisbeto 's fix no longer works in AM 1.1.4 using Angular 1.5.11. |
Actual Behavior:
What is the issue? *
Angular throws $compile:nonassign errors related to the md-visible attribute of md-tooltip when the user scrolls via mouse wheel, arrow keys, or page up/down. The tooltips still appear as expected, even though the error is printed to the console. Scrolling via scrollbar thumb or scrollbar arrows works without errors.
What is the expected behavior?
No errors in the console.
CodePen (or steps to reproduce the issue): *
CodePen Demo which shows your issue:
http://codepen.io/anon/pen/ozygQR
Details:
Angular Versions: *
Angular Version:
1.5.5, 1.5.8Angular Material Version:
1.1.0, 1.1.1Additional Information:
Browser Type: *
Firefox, ChromeBrowser Version: *
FF 45.4.0, Chrome 53.0.2785OS: *
Windows 7, CentOS 6Stack Traces:
"Error: [$compile:nonassign] Expression 'vm.hoverItem==item' in attribute 'mdVisible' used with directive 'mdTooltip' is non-assignable!
http://errors.angularjs.org/1.5.5/$compile/nonassign?p0=vm.hoverItem%3D%3Ditem&p1=mdVisible&p2=mdTooltip
minErr/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:68:12
initializeBinding/parentSet<@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:9757:1
parentValueWatch@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:9770:19
regularInterceptedExpression@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:15623:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:17064:34
o@https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js:7:14976
timeout/timeoutId<@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:19157:28
completeOutstandingRequest@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:5869:7
Browser/self.defer/timeoutId<@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:6145:7
"
The text was updated successfully, but these errors were encountered: