mardi 26 mai 2015

Ember-cli get relative path of a dependency

I have a unique issue that I can't get out because of how ember works with the dependencies. I am using this lib to check a phone number : http://ift.tt/1dv3iXk

And it's working fine, until that I have to set the relative path of a file call util.js like this to make some options works:

 $phoneInput.intlTelInput({
                    allowExtensions: false,
                    autoFormat: true,
                    autoHideDialCode: false,
                    nationalMode: false,
                    utilsScript: "/bower_components/intl-tel-input/lib/libphonenumber/build/utils.js"
                });

As you can see I tried to use /bower_components/intl-tel-input/lib/libphonenumber/build/utils.js but it can't find it. I also tried to add assets/ or ../bower_... but nothing is working, and I'm afraid this is not possible.

I did import the file in my Brocfile.js :

app.import('bower_components/intl-tel-input/lib/libphonenumber/build/utils.js');

And I can see it perfectly in the source.

Is there is a way to know the relative path of a dependency ?

I forgot to precise that I am initializing intlTelInput from a view within didInsertElement.

Thanks.




Aucun commentaire:

Enregistrer un commentaire