This project was generated with Angular CLI version 6.0.3.
Run npm install
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.
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.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
https://stackoverflow.com/questions/43557321/angular-4-how-to-include-bootstrap
https://stackoverflow.com/questions/45683192/angular-4-bootstrap-4-not-rendering-properly
import {enableProdMode} from '@angular/core'; enableProdMode();
Angular6, PHP, MySQL
- ng build --prod --build-optimizer
- after step 1, a dist folder will be generated, upload all files in dist folder to S3, make sure index.php is in the root directory.
- change the execution right of index.html to executable and change the base tag to point to the directory you want it to be the root of your website.
- Caches issue solved after using post method instead of get method
- URL routing issue solved by adding { useHash: true } in app-routing.noudle.ts:
@NgModule({ imports: [ RouterModule.forRoot(routes, { useHash: true }) ], // "useHash: true" solves URL routing issue on http serve exports: [ RouterModule ] })