Содержание
- 2. Архитектура приложения Angular Module Template Component metadata Directive metadata Event binding Property binding Injector Service
- 3. Module *.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; @NgModule({ imports:
- 4. export class AppComponent { title = ‘app works!’; } import { Component} from '@angular/core'; @Component({ selector:
- 5. Template *.component.html Hero List Pick a hero from the list {{hero.name}}
- 6. [(ng-model)] = “property” Data binding {{hero.name}} Two-way data binding DOM Component {{value}} [property] = “value” (event)
- 7. Directive import { Component} from '@angular/core'; @Component({ selector: ‘app-root’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.css’] }) app/.*component.html (structural)
- 8. @Injectable export class CourseService { constructor(private backend: BackendService) { } getCourses() { return this.backend.getAll(Hero); } }
- 9. Архитектура приложения index.html App Component Course List Component Course Component Course Details Component Course Service
- 10. Templates Flow app.module.ts course.module.ts course-list.component.ts course-details.component.ts app-course-details app-course-list course-list.component.html app.component.ts course-details.component.html course.component.ts app-course app-root course.component.html app.component.html
- 11. Data Flow app.module.ts course.module.ts course-list.component.ts course-details.component.ts app-course-details app-course-list app.component.ts course-details.component.html course.component.ts app-course app-root course.component.html app.component.html course.service.ts
- 12. Events Flow app.module.ts course.module.ts course-list.component.ts course-details.component.ts app-course-details app-course-list course-list.component.html app.component.ts course-details.component.html app-root app.component.html course.service.ts course.component.ts app-course
- 13. Задание По задаче из backlog’а сделать: Список необходимых компонент Описать назначение компонент Нарисовать эскиз шаблона для
- 15. Скачать презентацию