From the course Angular and NodeJS: A Practical Guide with Typescript by Antonio Papa
https://www.udemy.com/course/angular-node-admin/
and
The Complete Angular & NestJS Course
https://www.udemy.com/course/the-complete-angular-nestjs-course/
Added my notes and every command used in the project, hope you find this useful in learning about Angular. :)
ng new angular-admin --skip-git
-yes routing, css
ng g c nav
ng g c menu
ng g m public
ng g m secure
ng g c secure
ng g c public
ng g c public/login
ng g c public/register
// for api requests
ng g s services/auth
// DAO
// User has a role
//
ng g i interfaces/user
ng g i interfaces/role
ng g i interfaces/permission
ng g i interfaces/product
ng g i interfaces/order
ng g i interfaces/order-item
ng g interceptor interceptors/credential --skip-tests|--spec=false
ng g c secure/profile --skip-tests
ng g c secure/dashboard --skip-tests
ng g c secure/users --skip-tests
ng g c secure/users/user-create --skip-tests
ng g c secure/users/user-edit --skip-tests
ng g c secure/roles --skip-tests
ng g c secure/roles/role-create --skip-tests
ng g c secure/roles/role-edit --skip-tests
ng g c secure/products --skip-tests
ng g c secure/products/product-create --skip-tests
ng g c secure/products/product-edit --skip-tests
ng g c secure/components/paginator --skip-tests
ng g c secure/components/upload --skip-tests
ng g c secure/orders --skip-tests
ng g s services/user --skip-tests
ng g s services/role --skip-tests
ng g s services/rest --skip-tests
ng g s services/permission --skip-tests
ng g s services/product --skip-tests
ng g s services/order --skip-tests
---
To not generate test files (doesn't work: Data path "" must NOT have additional properties(skipTests).):
"@schematics/angular:component": {
"skipTests": true
},
"@schematics/angular:module": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
},
---
npm i c3
npm i -D @types/c3
---
---Angular Fixes
Fix: error TS2564: Property has no initializer and is not definitely assigned in the constructor.
tsconfig.json (under compilerOptions):
"noImplicitReturns": false,
"strictPropertyInitialization": false,
---Angular2+ Concepts
<router-outlet> => loads (child) components dynamically
-master-detail
normal forms => 2 way data binding
reactive forms
generated services can be injected as a dependency in components
@Input - to pass variables from parent component to child component (via html attribute)
-So only one component calls api once instead of multiple components calling the same api.
Interceptors => to do something additional for every request made. e.g. add credentials (cookies)
Event Emitter => Like redux/vuex to store global data (for component events to update other components)
-Emit and Subscribe to an event
-So only one component calls api once instead of multiple components calling the same thing.
[routerLink] vs routerLink
-brackets means you pass in variable (dynamic)
-w/o brackets means a string
(click/submit)
-parentheses mean event, which will trigger/call a function.
<ng-container></ng-container> doesn't show as an html element
angular-admin's Introduction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.