This project was generated with Angular CLI
ng generate @angular/material:dashboard ng generate @angular/material:dashboard --name=main-dash qui est un component avec un tableau d'objets qui utilise côté rendu un mat-list-grid et une directive structurelle pour itérer dans le tableau ng generate @angular/material:table ng generate @angular/material:table --name=dish-table qui est un component plus complexe puisqu'il a besoin d'un dataSource fortement typé via une interface
npm install angular-cli-ghpages --save-dev ng build --prod --base-href "https://julie-j-code.github.io/angular-restau-bookings" npx angular-cli-ghpages --dir=dist/restaurangular\wamp\restaurangular>
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.
ng add @angular/[email protected]
It will install a manifest.json + ngsw-config.json
run : ng build --prod
It will create files under dist/angular-pwa folder.
A PWA only runs on https and localhost environment. The Angular CLI is limited because the service worker do not work with the ng serve command. You have to create a build and host it separately, perhaps using http-server !!!!
To see a PWA in action, follow the below steps.
Navigate to that folder using cd dist/restaurangular Run http-server command (npm i -g http-server) Open We can create a script to shorten this process. Open a terminal and run npm run start-pwa command.
"start-pwa": "ng build --prod && http-server -p 8080 -c-1 dist/restaurangular"