With AngularJS, you cannot mix static content in with ngSwitchWhen elements inside of your ngSwitch container. Executing a switch-statement like this makes sense when you're dealing with a scripting context; however, when you're building and HTML DOM tree, this limitation can feel somewhat unnecessary. And, it doesn't have to be that way. The only reason it doesn't work now is because the ngSwitchWhen and ngSwitchDefault directives don't report their anchoring element - they only report their transclude functions. If, however, we tweak the code to keep track of the various anchoring elements, ngSwitch can easily contain both static and dynamic content.
Your new post is loading...