-
Notifications
You must be signed in to change notification settings - Fork 3.4k
$mdDialog bug using template vs. templateURL #3191
Comments
+1
In my case,
node is an empty array itself, and the expression (This doesn't fix the issue, just explains why the exception is thrown) |
Just faced the same issue. Dialogs with inlined templates simply don't open, because of js error. |
@GuyShaanan - your comment is helpful. |
Using $mdDialog to show html content without a mdDialog parent node will throw an error: ```js $mdDialog.show({ targetEvent: ev, controller : DialogCtrl, parent : angular.element(document.body), template : '<div ng-click="answer(\'string\')">click here</div>' } ``` If a mdDialog template does not contain a wrapper `md-dialog` node, then auto-wrap. If a `$mdUtil.extractElementByName` does not find the target element, warn the user. Fixes angular#3191. Fixes angular#4206.
Is the resolution here that you just cannot use a templateUrl? |
@jessekoconnor no, this was fixed in 22c34ba as part of |
I have two, almost identical scripts calling a
mdDialog
viamdDialog.show
. One of which, uses an inline template, the other, which references a templateUrl. The one that uses the inline template, throws ai.hasAttribute is not a function
error—while the other one works just fine.Not working (inline template)
http://plnkr.co/edit/m6HDhrgcVlXumwDhyQYu?p=preview
Working (templateUrl)
http://plnkr.co/edit/955VxMkBjPy5DvmQjIg0?p=preview
Known bug?
Just to note—this bug isn't plnkr specific, it's happening to me locally as well. Thanks!
The text was updated successfully, but these errors were encountered: