I'm building an iOS Phonegap app that uses AngularJS.
I've got some ng-includes inside an ng-switch that change the style of some list items depending on the item's category.
<div
ng-repeat="i indata"
ng-include="src='partials/card.html'""
>
</div>
Inside the partials/card.html file, is the switch:
<div
ng-switch on="i.group"
>
<div ng-switch-when="Music">
<div ng-include="src='partials/card_details/'+i.category+'.html'"
></div>
</div>
<div ng-switch-when="Film"
ng-include="src='partials/card_details/buy.html'"></div>
<!-- default, load group -->
<div ng-switch-default ng-include="src='partials/card_details/'+i.group+'.html'"
></div>
This all works perfectly in Chrome on my desktop browser, but when I run my Phonegap app, using the same sym-linked www folder as the pages running in Chrome, everything loads except the partials inside the switch statement.
I don't get any errors in the Xcode console, I've tried adding "/" to the start of the src as I've had problems with paths from the root in Phonegap, but what I don't get is why the partials/card.html loads and not the ones inside *partials/card_details*
Any ideas?
Is this because the ng-include in the line below has double quotes on the end of it:
<div
ng-repeat="i indata"
ng-include="src='partials/card.html'""
>
</div>
Try removing the _ (underscore) from the file names. I remember seeing a hint about this.
<div ng-include="src='partials/cardDetails/'+i.category+'.html'"></div>
instead of
<div ng-include="src='partials/card_details/'+i.category+'.html'"></div>
EDIT:
I have also discovered that ng-include is case sensitive when it comes to file names.