I am using intl-tel-input plugin in a Symfony project. We currently combine Assets in order to load all js script files into one.
However the intl-tel-input plugin requires utils.js in order to enable formatting/validation etc. and it needs to be included inside the script, like this:
utilsScript: "/Resources/js/vendors/utils.js"
However if I use that I get a 404 error (file utils.js not found).
How can I load that file on the script?
This is my complete script:
$(".js-phone").intlTelInput({
autoFormat: false,
autoHideDialCode: false,
autoPlaceholder: true,
defaultCountry: "auto",
geoIpLookup: function(callback) {
$.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});2
},
nationalMode: false,
utilsScript: "{{ include('/Resources/js/vendors/utils.js') }}" // utils.js enables formatting/validation etc.
});