Is there some documentation that allows understanding the different kinds of importing functionality into an Angular-Meteor app or a set of rules/checklist on how to determine from source how to form import statements for any given pakckage.
As I wrote in the other thread, you need to do it the Meteoric way; when you npm install directly, that’s just your local npm and not the scope of your meteor project.
Hi @areich, thanks for the pointer. That explains my item 1. and certainly put me on the right track for my issue with ngToast in the other thread.
As far as importing the package after correct install, and using the example of ngToast, I was reading the docs you referenced as saying that I should use
import ng-toast from 'ng-toast'; // package name is 'ng-toast'
which didn’t work.
Trying
import ngToast from 'ng-toast';
was more successful.
I then got an error telling my that ngSanitize was missing. Again, I had to make an educated guees and got the error removed with
import ngSanitize from 'angular-sanitize';
In the above cases, how should I have come to know that that ngToast and ngSanitize are the precise string required in the import statement?
Regarding your last question, you can use any valid identifier. So you could actually import AnyValidIdentifier from 'something', but not e.g. import x-y because that’s actually identifier x - (substract) identifier y. Just think valid variable names.
You also don’t always need a name if you just need to import something without ever using it, e.g. import from 'something' is fine too.
Generally if some packages need another package, they handle this themselves, except in the case of peer dependencies, which are expected to be installed app-wide.