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(sidenav): mdSideNav should support deferred or instant component …
…lookups Previous API does not support any way to determine if the component exists (has been instantiated) since the response will give a "fake" instance reference. The current API supports `$mdSideNav().find(id)`, `$mdSideNav().waitFor(id)`, `$mdSideNav(id)` usages. This fix will allow code like this: ```js // If the component has already been instantiated $scope.isOpenRight = function(){ return $mdSidenav('right').isOpen(); }; var right; // If the component will be created later $scope.isOpenRight = function(){ if ( angular.isUndefined(right) ) { $mdSidenav() .waitFor('right') .then(function(instance){ right = instance; }) } return right ? right.isOpen() : false; }; ``` Closes #7900
- Loading branch information
1 parent
4bff2bb
commit 877551c
Showing
4 changed files
with
161 additions
and
100 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
Oops, something went wrong.