Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 48 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
48
Dung lượng
94,81 KB
Nội dung
Lifecycle ngOnChanges Called after a bound input property changes ngOnInit Called once the component is initialized ngDoCheck Called during every change detection run ngAfterContentInit ngAfterContentChecked ngAfterViewInit ngAfterViewChecked ngOnDestroy Called after content (ng-content) has been projected into view Called every time the projected content has been checked Called after the component’s view (and child views) has been initialized Called every time the view (and child views) have been checked Called once the component is about to be destroyed Understanding Directives Attribute vs Structural Attribute Directives Structural Directives Look like a normal HTML Attribute (possibly with databinding or event binding) Look like a normal HTML Attribute but have a leading * (for desugaring) Only affect/ change the element they are added to Affect a whole area in the DOM (elements get added/ removed) Services & Dependency Injection What are Services? Application Centralization LogService AppComponent AboutComponent UserComponent log data to console store user data UserDetailComponent log data to console Data Storage UserService Hierarchical Injector AppModule AppComponent Any other Component Same Instance of Service is available Application-wide Same Instance of Service is available for all Components (but not for other Services) Same Instance of Service is available for the Component and all its child components Pipes Routing Forms Two Approaches Template-Driven Reactive Angular infers the Form Object from the DOM Form is created programmatically and synchronized with the DOM Adding Directives Root Dropdown Header Shopping List Recipe Book Shopping List Recipe List Shopping List Item Recipe Item Ingredient Recipe Detail Recipe Model Component Feature Adding Services Root Header Shopping List Shopping List Shopping List Recipe Book Recipe Recipe List Shopping List Item Recipe Item Ingredient Recipe Detail Recipe Service Model Component Feature Adding Routing Root Header Shopping List Shopping List Shopping List Recipe Book Recipe Recipe List Shopping List Item Recipe Item Recipe Detail Ingredient Recipe Edit Recipe Service Model Component Feature Adding Forms Root Header Shopping List Shopping List Shopping List Recipe Book Recipe Recipe List TD Shopping List Item Recipe Item Recipe Detail Ingredient Recipe Edit Recipe Forms Service Model Component R Feature Adding Modules Root Header Shopping List Shopping List Shopping List Recipe Book Recipe Recipe List TD Shopping List Item Recipe Item Recipe Detail Ingredient Recipe Edit Recipe Forms Service Model Component R Feature What changed in the Course Update? Angular is NOT a re-write of Angular 2! Angular is only an update to Angular (now only “Angular”) Angular Team switched to Semantic Versioning and renamed Angular to Angular (Angular will be AngularJS) Semantic Versioning MAJOR.MINOR.BUGFIX e.g 2.4.3 e.g 4.0.1 Basics First Getting Started Getting Started Components, Templates & Databinding Angular Basics Course Project Course Project Directives More on Components & Databinding … Course Project More on Directives … Debug Eearlier … Getting Started Directives Angular Basics Course Project Course Project Debugging an Angular Application Debugging … … Observables … … Routing Routing Course Project Understanding Observables … Course Project … Improved Content Tried to sharpen Explanations in all Modules Added a Basics Section to learn the Core Features Faster More Details in Routing, Forms and Optimizations Module Changed Authentication Module to now use the Recipe Book The Deployment Section now uses the Recipe Book as an Example How to Continue "Old Content" is kept around until end of April (I will inform you before it‘s removed!) Keep in mind: Angular Syntax = Angular Syntax The "old Content" is still correct! You don‘t have to go through the updated Content at all! Download "old" lectures! How to Continue (if you want to use the new Content) Getting Started Getting Started Components Basics Course Project Course Project Directives Components Course Project Services Start at Basics Have a look at the Lecture Titles and skip over Lectures you‘re not interested in Course Project Directives … … Course Roundup Course Roundup How to Continue (if you want to use the new Content) Getting Started Getting Started … … Routing Routing Course Project Course Project Forms Restart at Routing/Forms/ … Forms … Download latest Updated Recipe Book Project … Course Roundup Course Roundup How to Continue (if you want to use the new Content) Getting Started Getting Started … … Routing Course Project Go through the updated Curriculum and have a look at the Sections & Lectures you found most important Routing Course Project Forms Forms … … Course Roundup Course Roundup ... AppComponent Component Component Component Directive Directive Shared Modules AppModule FeatureModule1 FeatureModule2 Component Component Component Component Shared Module Directive Directive Modules