Reputation: 23
I have a tab service provider which shows details of a customer. When you click the tab, it shows empty fields to edit and gives this error
angular.js:12477 TypeError: $(...).intlTelInput is not a function
After refreshing the page, the error disappears. What could be the issue?
I have put my intlTelInput
function inside a timeout function but it didn't work.
This is my code
if ($("input[name='code']").length >= 1) {
$("input[name='code']").intlTelInput({
separateDialCode: true,
initialCountry: "auto",
geoIpLookup: function (callback) {
$.getJSON("https://freegeoip.net/json/", function (data) {
callback(data.country_code); `
});
}
});
}
This is the complete error
angular.js:12477 TypeError: $(...).intlTelInput is not a function at Object. (http://localhost/taskm-rio/public/admin/app/ng-controllers/providerController.js:104:49)
Upvotes: 1
Views: 2034
Reputation: 1622
Add utils.js in scripts,
`"scripts": [
"node_modules/intl-tel-input/build/js/utils.js"
]`
in angular.json file. This will solve your issue.
Upvotes: 1