Open kumarsatish876 opened 7 years ago
Hi @kumarsatish876 - did you include the library via a script tag in your page?
Hi @benkeen I was trying to use it in my angular project. I had included the script in angular-cli.json file as
"scripts": [
"../node_modules/country-region-selector/dist/crs.min.js",
"../node_modules/country-region-selector/dist/crs.js"
]
Neither of them worked. I also tried jquery.crs.min.js file but did not work for me.
Ah okay. Hmm... my hunch is that probably Angular is loading them async - or after the page has rendered. Take a look at this section: https://github.com/benkeen/country-region-selector#working-with-dynamic-html
You could maybe try calling crs.init()
after you know that both the script has loaded and your DOM is ready with the two fields added.
The other possibility is that Angular is controlling the DOM and preventing the script automatically updating... I'm not sure, I'm afraid. My Angular is a bit rusty.
Either way, I think an Angular version of this script is needed. :)
I have installed country-region-selector using below command
In my HTML I used it like this
but Countries are not showing in dropdown