You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
// Async lookup for sidenav instance; will resolve when the instance is available
$mdSidenav(componentId).then(function(instance) {
$log.debug( componentId + "is now ready" );
});
However, when I do that, I get an error in the logs:
angular.js:13550 SideNav 'left' is not available! Did you use md-component-id='left'?(anonymous function) @ angular.js:13550findInstance @ angular-material.js:15747(anonymous function) @ angular-material.js:15712(anonymous function) @ index.dev.html:520invoke @ angular.js:4665(anonymous function) @ angular.js:4473forEach @ angular.js:322createInjector @ angular.js:4473doBootstrap @ angular.js:1746bootstrap @ angular.js:1767gamingPlatformInitFinished @ index.dev.html:530(anonymous function) @ app-gameinvite-common-code.ts:258trigger @ angular.js:3166defaultHandlerWrapper @ angular.js:3456eventHandler @ angular.js:3444
Even when passing true, it still logs the error:
$mdSidenav('left', true);
Except the error logs, things work correctly: the promise is resolved correctly :)
The problem is that it spams the error logs (and i have protractor tests that make sure the error log is empty).
The problem is in this code:
/** * Service API that supports three (3) usages: * $mdSidenav().find("left") // sync (must already exist) or returns undefined * $mdSidenav("left").toggle(); // sync (must already exist) or returns reject promise; * $mdSidenav("left",true).then( function(left){ // async returns instance when available * left.toggle(); * }); */returnfunction(handle,enableWait){if(angular.isUndefined(handle))returnservice;varinstance=service.find(handle);// THIS IS THE BUG: if enableWait is true, then it should use waitForInstance (and not findInstance).BecausefindInstancelogsanerroriftheinstanceis not ready:
functionfindInstance(handle){varinstance=$mdComponentRegistry.get(handle);if(!instance){// Report missing instance$log.error($mdUtil.supplant(errorMsg,[handle||""]));