Hi
On Monday, October 3, 2016 at 10:21:40 AM UTC+2, Sander Elias wrote:
>
> If you export things explicitly, it's very hard to accidentally expose a
> thing that should have been private.
>
I agree, at least in part, that explicit exports let you target specific
stuff. But if the things should have been private, they wouldn't be
exported out of the original module in the first place, right?
Anyway, I usually use *** in barrel files. Typically I'll have something
like a service in a folder with maybe an interface file, a service file,
maybe a helper component or something, and then an index.ts which will
export all those things out the files like that. Then otherwhere when I
import stuff, say like this: *import { } from ../services/index*, Sublime
(what I use) will offer me autocomplete on all the things across the entire
service so my imports in other files are a bit more compact.
Not sure if that's a good way, though.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.