NativeScript / docs-v8

https://docs.nativescript.org
29 stars 42 forks source link

Adjust import statement so that it work as example #99

Open reneroboter opened 2 years ago

reneroboter commented 2 years ago

The current import statement in the plain tutorial doesn't work. So I adjusted it to a real working example. I'm not a java script expert, maybe it's better to introduce an index.jsfile, so that the current example work. However I guess this approach is more beginner friendly. Cause it's don't need the knowledge about a import statement with an index.js file.

rigor789 commented 2 years ago

Good catch, I believe the imports are correct for the GitHub sample repo, but not the tutorial content itself - in the repo, there are index.ts files in the models and services folders that export everything:

https://github.com/NativeScript/tutorials/blob/main/plain-tutorial/app/services/index.ts https://github.com/NativeScript/tutorials/blob/main/plain-tutorial/app/models/index.ts

We should either include those in the tutorial text, or drop them and just use full imports. I'm fine with either way...

/cc @NathanWalker @williamjuan027

reneroboter commented 2 years ago

@rigor789 i didn't noticed that there is a repo for the tutorials, therefor a would recommend also to use the index.js in the tutorials :)