Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

$mdSidenav: change to promise-based API, add documentation #1311

Closed
ajoslin opened this issue Jan 27, 2015 · 7 comments
Closed

$mdSidenav: change to promise-based API, add documentation #1311

ajoslin opened this issue Jan 27, 2015 · 7 comments
Assignees
Milestone

Comments

@ajoslin
Copy link
Contributor

ajoslin commented Jan 27, 2015

$mdSidenav('left').then(function(leftNav) { leftNav.close(); });
@ajoslin ajoslin self-assigned this Jan 27, 2015
@ajoslin ajoslin added this to the 0.8.0 milestone Jan 27, 2015
@ThomasBurleson ThomasBurleson assigned rschmukler and unassigned ajoslin Jan 30, 2015
@rschmukler rschmukler modified the milestones: Backlog, 0.8.0-rc1 Feb 7, 2015
@rschmukler
Copy link
Contributor

@ajoslin what's the thought on a promise based API here? There's nothing async about the get operation, so perhaps this is just extra abstraction?

@ThomasBurleson
Copy link
Contributor

@rschmukler - just like the $componentRegistry, there are use cases were a user is querying for the component BEFORE it is ready/registered. A the promise-based API keeps the API consistent with $mdDialog, $componentRegistry, etc. Should we discuss this offline?

@rschmukler rschmukler added the needs: team discussion This issue requires a decision from the team before moving forward. label Feb 8, 2015
@dmackerman
Copy link

This would be super useful. In our app, we load a lot of "detail" information in a Sidenav, and we utilize ui-router's onEnter and onExit callbacks to hide/show sidenavs. This would ensure that the Sidenav is available before we show anything. 👍

@rschmukler: it could be async in the case that the component isn't ready, as other directives/templates have to be compiled before it if it's being included in a sub-state, etc.

@AllenSH12
Copy link

+1 for at least the docs, my guess is a lot of people (myself included) primarily want to use the sidenav as it works in mobile apps, click an option and it goes away. It's possible to figure out from the repo but takes some work.

@rschmukler @ThomasBurleson @ajoslin if I can be of any assistance documenting or being a guinea pig please ask.

@robertmesserle robertmesserle modified the milestones: 0.10.0, Backlog Mar 25, 2015
@robertmesserle robertmesserle added type: enhancement and removed needs: team discussion This issue requires a decision from the team before moving forward. labels Mar 25, 2015
@quantuminformation
Copy link

What is the correct way to inject this $mdsideNav? For some reason I'm getting

Uncaught TypeError: $mdSidenav is not a function. When attempting

  $scope.toggleMenu = function () {
            $mdSidenav('left')
              .toggle()
              .then(function () {
              });
          };```

@ryananthonydrake
Copy link

I'm getting the same issue as QuantumInformation above. Any other comments?

public close() {
                console.log('CLOSE FIRED');                
                this.$mdSidenav('left').close()
                .then(function () {
                    console.log("close LEFT is done");
                });;  
                console.log()                             
            }      

@ThomasBurleson
Copy link
Contributor

@quantuminformation

Please post your question in the Angular Material Forum

@angular angular locked and limited conversation to collaborators Oct 8, 2015
@Splaktar Splaktar modified the milestones: 0.10.0, 0.9.0 Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants