After upgrading liftweb, lift-ng, bootstrap and angular I found that angular's ngSwitch directive was no longer working. I was using <div ng-switch on="..."> and had to change to <div ng-switch="..."> which in itself is not an issue but I wanted to know why. My first path was down the angular route - see
https://groups.google.com/d/msg/angular/_dwjGEUNNuI/hVyxio3rAQAJ for reference.
As I started digging in (refer to link for background) I found that it does appear that somehow lift (one of it's components, or me) is creating a on event which is causing on attribute to fail in ngSwitch.
If I add code:
and inspect dom I see a lift generate id, looking further in lift/page js file I see entry lift.onEvent("lift-event-js-F1221851018621TQ2PL1","",function(event) {testme;});
Changing html code to read:
<div onabc="testme">a</div>
shows lift.onEvent("lift-event-js-F1221851018832YOVYZQ","abc",function(event) {testme;}); in js file generated in lift/pages. Here you can clearly see stripped off 'on' and remaining 'abc'.
Changing attribute to 'myon' does not generate this onEvent entry in js file.
This ties very much with what I saw (refer to link).
How do I hunt this down? I have no directives in my code for 'on'.
I have further reduced my html file down to minimum, even dropping the snippet for now, same results
<!DOCTYPE html>
<body class="lift:content_id=main">
<div ng-app="myApp" id="main" data-lift="surround?with=default;at=content">
<div id="controller" data-ng-controller="DeviceCtrl" >
<!-- Prerequisite stuff the plugin needs -->
<script data-lift="Angular" type="text/javascript"></script>
<script id="angularscript" type="text/javascript"></script>
<div data-lift="embed?what=_scripts">replaced with embedded content</div>
<div ng-cloak ng-hide="error === undefined || error.length === 0"
class="error-list">
<section>
<h3>Exceptions:</h3>
<ul>
<li ng-repeat="err in error"><pre>{{err.trim()}}</pre></li>
</ul>
</section>
</div>
<div ng-cloak ng-show="error === undefined || error.length === 0">
<section ng-cloak class="banner">
<p class="lead">
<span class="lift:loc?locid=label.editing">Editing</span>: <span>{{currentUser.firstname}} {{currentUser.lastname}}</span>
</p>
</section>
<div onab="testme">a
</div>
</div>
</div>
</div>
</body>