Notes, tutorials, experiments, playground for Angular 9+
ng serve
ng generate
Collection "@schematics/angular" (default):
appShell
application
class
component
directive
enum
guard
interface
library
module
pipe
service
serviceWorker
universal
webWorker
ng build
ng build --prod
ng test
ng e2e
- Prettier
- Replace Karma with Jest
- Replace Protractor with Puppeteer
- Use Spectator as test helper
- Add Husky
- Create a login page (Form: username, password, submit)
- POST credentials to /api/login
- Use response headers and interceptors to track auth sessions
- Dealing with session cookies
- Add AuthGuard
- Create CurrentUser service
- Add/remove Mirage.js from production build.
- Activate/deactivate Mirage.js before Angular Router.
Option #1: Original Bootstrap 4.
$ yarn add bootsrap
$ yarn add jquery
$ yarn add popper.js
$ echo '@import "~bootstrap";' >> src/styles.scssExtend angular.json to import external packages in projects > hello-angular > architect > build > options.
"scripts": [
"./node_modules/jquery/dist/jquery.slim.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"
]Option #2: ng-bootstrap. No animation and custom API.
$ yarn add bootstrap
$ echo '@import "~bootstrap";' >> src/styles.scss
$ yarn add @ng-bootstrap/ng-bootstrapOption #3: ngx-bootstrap
- It comes with animation out of the box.
- This is my suggested package.
$ yarn add ngx-bootstrap bootstrapInstead of importing files in angular.json add import to styles.scss.
@import '~bootstrap';
@import '~ngx-bootstrap/datepicker/bs-datepicker';-
Add new
"store"route toapp-routing.module.ts. -
Add top bar with store name and checkout icon
-
Add title for product list
ng add @briebug/jest-schematic
- Check
package.jsonfile. Remove almost everything which iskarmaandjasminerelated. You can remove the@briebug/jest-schematicalso. - If you need
protractor, you can keep thejasmine-spec-reporterpackage. - Run
yarn format.
Known issue: projects are not supported out of the box, they need a manual adjustment.
Add Spectator as default collection:
$ ng config cli.defaultCollection @ngneat/spectator