Views
Replies
Total Likes
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).
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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).
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
@orotas - that's what I meant by "ugly"
Generating JS (or CSS or JSON) with Sightly is possible, but because it uses HTML constructs, it looks weird. Although arguably the same thing could be said about JSP or ESP.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies