I have removed turbolinks from application.js and I am working on an AngularJS project. In a form where I have some select2 dropdowns and some datetimepickers, the JS code doesn't load If I don't refresh the page.
I have also added data-no-turbolinks in my links (despite I disabled turbolinks) but the issue still occurs. I am working on development environment.
My JS file:
var ready;
ready = function() {
// DateTime pickers for Start time, End time
$(function () {
$('#dtp_start_time').datetimepicker();
$('#dtp_end_time').datetimepicker();
});
// Select2 box for search select boxes in Outage form
$(".search_select").select2();
};
$(document).ready(ready);
$(document).on('page:load', ready);
$(document).on('page:change', ready);
From my experience with Rails, loading JS in such ways is a pain, so how do I make it work ?
//= require file.jsby application.js. – Radolino Dec 1 '15 at 9:23