<!-- testme set in controller -->
<!-- doesn't work, rendered output includes neither of the two switches -->
<div ng-switch on="testme">
<div ng-switch-when="1">....</div>
<div ng-switch-default>....</div>
</div>
<!-- does work as expected -->
<div ng-switch="testme">
<div ng-switch-when="1">....</div>
<div ng-switch-default>....</div>
</div>
<!DOCTYPE html>
<html>
<head>
<script data-require="angul...@1.6.5" data-semver="1.6.5" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-app ng-init="testme=1">
<h1>Hello Plunker!</h1>
<div ng-switch on="testme">
<div ng-switch-when="1">one one</div>
<div ng-switch-default>one none</div>
</div>
<div ng-switch="testme">
<div ng-switch-when="1">two one</div>
<div ng-switch-default>two none</div>
</div>
</body>
</html>
--
You received this message because you are subscribed to a topic in the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/_dwjGEUNNuI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
<ng-switch ona="testme">
<div ng-switch-when="1">one one</div>
<div ng-switch-default>one none</div>
</ng-switch>
watch expression undefined
watch expression triggered undefined
<ng-switch onabc="testme">
<div ng-switch-when="1">one one</div>
<div ng-switch-default>one none</div>
</ng-switch>
watch expression testme
watch expression triggered 1