This is one of several repos that I created for the course "Angular - The Complete Guide (2022 Edition)". For a complete list of repos created for this course: https://gist.github.com/christophervigliotti/92e5b3b93cbe9d630d8e9d81b7eb6636 .
- [ngStyle]="{color: getColor()}"
- #noServer is a "local reference"
- *ngIf="serverCreated; else noServer"
server was created, server name is {{ serverName }}
server not created...waiting...for you to create a server...so please do it...
## 38 - Using igIf to output data conditionally - *ngIf="serverCreated"server was created, server name is {{ serverName }}
directives are instructions in the DOM
Receives a green bkg
@Directive({ selector:'[appTurnGreen]' }) export class TurnGreenDirective{ ... }- servers.component.*
- servers.component.*
- app.module.ts
- changes to app.module.ts
- added import {FormsModule} from '@angular/forms';
- added to NgModule imports array: FormsModule
- servers.component.*
- https://www.udemy.com/course/the-complete-guide-to-angular-2/learn/lecture/6655820#overview
- servers.component.*
- https://www.udemy.com/course/the-complete-guide-to-angular-2/learn/lecture/6655814#overview
- servers.component.*
- servers.component.*
- server.component.*
- (see repo basics-assignment-1)
- 24.a component as an attribute
- 24.b component as a class
- servers.component.ts
- app.component.html
- notes in app.components.ts
- notes in servers.component.ts
- ng generate component servers
- or "ng g c servers"
- more notes in servers.component.html
- module loads into index.html...it's magic!
- notes found in app.modules.ts
- notes found in server.component.ts
- a key feature in Angular
- you build your app from composing components (which you build on your own)
- ideas for how to compose headers...header, main nav, main body, sidebar, footer
- each component has it's own template, html code and business logic
- the root component for this app
- a "normal html file" but with one exception...
- Loading...
- @Component decarator...looks like I can change some default stuff here
- selector value matches the app-root tag in index.html
- when I change the tag and the selector value and refresh the page the content loads
- view source of index.html...
- <script src="runtime.js" type="module"></script><script src="polyfills.js" type="module"></script><script src="styles.js" defer></script><script src="vendor.js" type="module"></script><script src="main.js" type="module"></script>
- first code executed is contained here
- this line bootstraps (starts) our app by passing AppModule...platformBrowserDynamic().bootstrapModule(AppModule)
- bootstrap array lists components that should be known to Angular at the time that it analyizes our index.html file...bootstrap: [AppComponent]
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.