This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dialog): improve support for template and templateUrl options
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 #3191. Fixes #4206.
- Loading branch information
1 parent
e26a275
commit 22c34ba
Showing
6 changed files
with
91 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ angular | |
.module('material.core') | ||
.factory('$mdUtil', UtilFactory); | ||
|
||
function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $interpolate) { | ||
function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $interpolate, $log) { | ||
// Setup some core variables for the processTemplate method | ||
var startSymbol = $interpolate.startSymbol(), | ||
endSymbol = $interpolate.endSymbol(), | ||
|
@@ -462,6 +462,8 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in | |
return angular.element(element[i]); | ||
} | ||
} | ||
|
||
$log.warn( $mdUtil.supplant("Unable to find node '{0}' in element.",[nodeName]) ); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dylang
|
||
return element; | ||
}, | ||
|
||
|
I'm running into this now after bumping the version of Angular Material and it it's been difficult to debug. I wish the error message addressed the resolution to avoid getting into this quandary.