This project was generated with Angular CLI version 6.0.1.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
To dockerize production, use docker-compose build
and docker-compose up
commands.
To add translations, you need to add languages with following steps:
Append language as "next_language" to extract_langs
script:
"extract-langs": "ng xi18n --output-path i18n --i18n-locale en && xliffmerge --profile xliffmerge.json en pl de next_language",
Add another scripts with new language:
"start-next_language": "ng serve --configuration=next_language --poll=2000 --open"
{
"...": "...",
"configurations": {
"...": "...",
"next_language": {
"aot": true,
"outputPath": "dist/angular-testing-next_language",
"i18nFile": "src/i18n/messages.next_language.xlf",
"i18nFormat": "xlf",
"i18nLocale": "next_language"
}
},
"...": "...",
"serve": {
"...": "...",
"next_language": {
"browserTarget": "angular-testing:build:next_language"
}
}
}
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Use ng build --configuration staging
command for a staging build.
Run ng test
to execute the unit tests via Karma.
To run, declare environment variable by using env CHROME_BIN = /usr/bin/chromium
.
To merge translations to different languages, use npm run translate-{lang}.
That concept was realised with xliffmerge article by martinroob.
Run ng e2e
to execute the end-to-end tests via Protractor.
Project structure can be found in following link: Angular 5 Structure Multiple Modules
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.