Angular JS is a front-end framework for web applications. It allows you to extend HTML’s syntax to present dynamic content through two-way data-binding.
- Angular directives are special commands used within the framework
- All directives start with ‘ng-‘ then the name of the directive
- Expressions are written in the HTML and are wrapped with
{{ }}
which is used to add JavaScript within the HTML - Two-way data binding ties the view and model together
- Angular is used for the view in MVC architecture
- M is for model (or data)
- V is for view
- C is for controller (JavaScript that links your data to your template, creates the interaction between your model and your views)
- Modules are specific JavaScript files used to take care of different tasks
- Service is a small piece of code that takes care of common tasks
- $http is a service that handles communications between an http server and your application
- Deep linking looks at the location URL and manages how it maps to the current state of the page
- $scope service allows you to pass variables between the JS and the HTML
Directives for form validations:
- ng-required
- ng-minlength
- ng-maxlength
- ng-pattern
Properties for the models:
- $pristine (class ng-pristine)
- $dirty (class ng-dirty)
- $touched (class ng-touched)
- $valid (class ng-valid)
- $invalid (class ng-invalid)