I am new to sails js. I am passing a object from controller to view in sails js. I can access to that object from ejs (embedded javascript) file. But I need to access that object from a javascript file. Should I need to use the object in a hidden field or is there a better way to get the object to javascript file.
access controller object from a javascript file in sails js
803 Views Asked by Gayan Charith At
2
If you need to access it Javascript then you can simply save the value to a JavaScript object in your view page and this access it after page load.
viewFile.ejs
jqueryExample.js