tutorial notes
authorBill Erickson <berickxx@gmail.com>
Wed, 13 Jun 2018 16:44:19 +0000 (12:44 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 13 Jun 2018 16:44:19 +0000 (12:44 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
ang6-toturial.adoc

index a87c45d..930e363 100644 (file)
@@ -7,8 +7,52 @@
 
 == Modules ==
 
+Modules serve 2 main functions:
+
+* Defining entry points for pages
+* Importing and exporting dependencies.
+
+== Modules ==
+
+[source,js]
+------------------------------------------------------------------------
+@NgModule({
+  declarations: [
+    // List of components declared by this module.  
+    // Every component used must be declared exactly once!
+  ],
+  imports: [
+    // List of imported modules.  
+    // These modules may be needed by the current module
+    // or simply imported so they can be re-exported (below).
+  ],
+  exports: [
+    // List of components and modules made implicitly 
+    // available to any module that imports this module.
+  ],
+  providers: [
+    // List of services available to this module and any 
+    // module that imports this module.
+  ]
+})
+------------------------------------------------------------------------
+
+== Component Declaration Hierarchy ==
+
+Module Foo declares Component SomeCompent.
+Module Bar wants to use Component SomeCompent.
+Module Bar cannot also declare SomeComponent.
+
+Module Bar must import Module Foo.
+OR SomeComp is declared in a new shared module that is imported
+by both Foo and Bar.
+
 == Templates ==
 
+*ngFor *ngIf 
+<ng-template>
+<ng-container>
+
 == Template Variables ==
 
 <foo-component #myComp>