The goal is to show a collection of parking slots and let the user buy one. This must be a "Widget" because it should be an independent module that can be embedded in any Web application. I am an Angular developer, therefore I will write a reusable component for an Angular application.
The widget is composed of:
The vendor area should list the features of the vendor in a togglable manner. It should act as a filter for parking slots.
The parking slot area contains all the parking slots.
Before building the widget install all dependencies with the command:
npm installTo build the widget issue the following command from the root of the repository structure:
ng build widgetThe project will be built in the dist/widget directory.
The widget's API documentation is available by clicking the docs badge at the beginning of this page.
The documentation can be generated with:
npm run compodocThe generated documentation will be in the docs folder for interoperability
with GitHub Pages and the above link.
The tool ng-packgr still does not support exporting assets with the package so translations are not yet available with this release. As soon as the relevant pull request will be released it will be possible to resume work on this feature.
Issue the command npm publish command after testing, and building the widget to
have it published in the default npm registry. You must be logged in the default
registry for this to work.
Then run npm install parking-widget to install in any project.
Copy the dist/widget folder in the node_modules folder of the destination project.
The demo project is already setup to get the package from that folder. Don't symlink it,
as it will not work that way!
You could install a local copy of an NPM registry (like Verdaccio from https://verdaccio.org/), configure it, and start it. It must act as an NPM registry proxy, too. This is still work in progress.
The test proejct it at https://github.com/marcobuschini/interview-november-2019. It the widget was installed "the easy way" described above.
This widget uses NGX Translate for internationalization. To extract
the strings to translate use the command npm run extract-i18n. This will generate the file
projects/widget/assets/i18n/strings.pot that can feeded into any translation tool that generates
translations in JSON format, such as OneSky. Download the translated
files ZIP archive and unpack it into the projects/widget/assets/i18n/ folder.