简体   繁体   中英

Angular JS Ng-switch default state?

I'm really new to AngularJS but I wondered if anyone knew how to get a default ng-switch state working on the following plunkr, at the moment I can only get it to work on click, but if the user button is toggled then really the menu should show first time.

http://plnkr.co/edit/bdu1T29cYe6mhb6OAFI8?p=preview

Any ideas? ng-switch-default didn't seem to do the trick on the user component...

cheers

phil

I'm not sure why you're using two separate variables when they're just configuration strings. Use both the same and everything works fine.

http://plnkr.co/edit/C28EwkuufYKs9Ipi0sA5?p=preview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM