Size: 1707
Comment:
|
Size: 2031
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 6: | Line 6: |
== Concepts from AngularJS == * https://docs.angularjs.org/guide/concepts * Model - the data shown to the user in the view and with which the user interacts * View - what the user sees (the DOM) * Controller - the business logic behind views * Dependency Injection - Creates and wires objects and functions |
Angular
Angular is a platform and framework for building single-page client applications in HTML and TypeScript.
The architecture of an Angular application relies on certain fundamental concepts. The basic building blocks are NgModules, which provide a compilation context for components.
Concepts from AngularJS
https://docs.angularjs.org/guide/concepts
- Model - the data shown to the user in the view and with which the user interacts
- View - what the user sees (the DOM)
- Controller - the business logic behind views
- Dependency Injection - Creates and wires objects and functions
Components
Components define views. Components use services, which provide specific functionality not directly related to views. Service providers can be injected into components as dependencies, making your code modular, reusable, and efficient.
Each component defines a class that contains application data and logic, and is associated with an HTML template that defines a view to be displayed in a target environment.
Template
A template combines HTML with Angular markup that can modify HTML elements before they are displayed. Template directives provide program logic, and binding markup connects your application data and the DOM. There are two types of data binding: Event binding lets your app respond to user input in the target environment by updating your application data; Property binding lets you interpolate values that are computed from your application data into the HTML.
Services, dependency injection
For data or logic that isn't associated with a specific view, and that you want to share across components, you create a service class. A service class definition is immediately preceded by the @Injectable() decorator.
Router - navigation
The Angular Router NgModule provides a service that lets you define a navigation path among the different application states and view hierarchies in your app