Alert and confirm -dialogs throw errors
Since 0.11.0(-rc?) my alert and confirm dialogs have been throwing Cannot read property '$eval' of undefined at angular-material.js:660
Custom dialogs are working as before.
I'm guessing it has something to do with the new md-autofocus attr. I can't reproduce the issue outside of the app I'm working.
Worked around the problem by adding focusOnOpen: false
This is a logic issue with $mdUtil.findFocusTarget( )
there still seems to be an issue with the alert and confirm dialogs when debug info is disabled.
Code Pen: http://codepen.io/anon/pen/BoopZj
It appears to be related to the confirm dialog template: md-autofocus="dialog.$type!='confirm'">. The end result is in function below it.scope() is undefined.
findFocusTarget: function(containerEl, attributeVal) {
var elToFocus, items = containerEl[0].querySelectorAll(attributeVal || '[md-autofocus]');
// Find the last child element with the focus attribute
items.length && angular.forEach(items, function(it) {
it = angular.element(it);
// If the expression evaluates to FALSE, then it is not focusable target
var focusExpression = it[0].getAttribute('md-autofocus');
var isFocusable = focusExpression ? (it.scope().$eval(focusExpression) !== false ) : true;
if (isFocusable) elToFocus = it;
});
return elToFocus;
},
+1, I still have the same issue with the latest master
@rrajewski - Your comments are very helpful and provide important specifics. Thank you. Re-opening.
$compileProvider explains that $compileProvider.debugInfoEnabled(false) will make the scope() function return undefined: @see https://github.com/angular/angular.js/commit/dbbe6b3831e9e3545e3fae6d109aab6251131d82