This document discusses building powerful enterprise applications with Angular and TypeScript. It provides an overview of key concepts in Angular including modules, components, templates, directives, services, routing and data binding. It also covers TypeScript features such as static type checking, transpiling to JavaScript, and advantages for productivity and managing large codebases. The document demonstrates how Angular and TypeScript can be used together to build robust single page applications.
19. @DavidGiard
Modules
• Built into Angular
• Makes it easier to split code into smaller pieces
• Import one module into another
• Export module to make it available for import
20. @DavidGiard
Modules
import {Component} from 'angular2/core';
@Component({
selector: 'my-selector',
template: '<h1>Hello World</h1>'
})
export class DemoComponent { }
Available
outside this
module
Use exported
module
In this module
provides additional definition files for libraries that the TypeScript compiler doesn't natively recognize.
COMPONENT =
Template (view, including HTML, bindings, directives)
+ Class (properties / methods; created with TypeScript)
+ Metadata (decorator: from Angular)
structural directives (*ngIf, *ngFor)
Replaces HTML