Angular is a front end application framework that is designed to write testable single page applications (SPAs).
Angular Website An exampleThe Model plays the role of managing application data. A model could represent a user, product information, list of movies, etc.
The View is the visual representation of the model. The view should not contain any logic. It accepts user input and passes it to the controller.
The controller responds to the user's interaction with the View. It performs validation and other business logic. It is considered 'best practice' to keep controllers slim.
The Angular CLI makes it very easy to create a new application, create new components, and test locally.
npm install -g @angular/cli
This installs all the dependencies needed to run the Angular CLI from the command line.
ng new MY-PROJECT-NAME
cd MY-PROJECT-NAME
ng serve
The new
command has several useful flags available in it.
--dry-run
--prefix
--routing
--style
e2e
- End to End tests.angular-cli.json
- CLI settingsindex.html
main.ts
- Main bootstraperstyles.css
- Global Stylesapp.module.ts
app.component.ts
app.component.spec.ts
app.component.html
app.component.css
ng generate component my-new-component-name
#which is equal to
ng g component my-new-component-name
#You can also assign folder paths
ng g component shared/components/my-small-component