Correction - I take it back. Sightly can be used to generate JS. It's just a bit ugly because you still need to use HTML tags and you must be sure to use data-sly-unwrap. Sorry for the misinformation. The script name would look like controller.js.html (vs. controller.js.jsp).
What would best practice be however? I assume best practice would be use a JSP or Ecma to generate a dynamic JS file. Sightly is defined as being an HTML templating system right, so if you aren't generating HTML shouldn't you be using a different templating language?
No. Sightly (at least now) is only able to generate HTML. You could generate JS inside <script> tags in an HTML page, but you can't use Sightly to generate a standalone JS script. The same would be true for JSON, CSS, etc.
I am just trying to create a angular mobile app using sightly.
In a geomatrix outdoors app example, controller java script is generated via controller.js.jsp using sling. (E.g. geometrixx-outdoors-app/components/angular/ng-image). The java script is dynamically prepared using jcr properties.
How to do this in sightly?
PS: I have gone through the sightly documentation site but couldn't get how to implement this.