docs-v8 icon indicating copy to clipboard operation
docs-v8 copied to clipboard

Adjust import statement so that it work as example

Open reneroboter opened this issue 2 years ago • 2 comments

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.

reneroboter avatar Aug 31 '22 10:08 reneroboter

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

rigor789 avatar Aug 31 '22 11:08 rigor789

@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 :)

reneroboter avatar Aug 31 '22 12:08 reneroboter