aliases:
- Angular (web framework)
tags:
- Type/Tech/Language/JavaScript
- area/tech/dev
- newMovie
from:
- "[[JavaScript Frameworks]]"
related:
contra:
to:
dateCreated: 2022-08-12, 20:24
dateModified: 2023-12-23, 07:34
version: 1
publish: true
Angular is a TypeScript-based, free and open-source single-page web application framework led by the Angular Team at Google and by a community of individuals and corporations. Angular is a complete rewrite from the same team that built AngularJS. | |
---|---|
wikipedia:: Angular (web framework) |
ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.{{ someReference }}
<img [src]="variableName"/>
<input [name]="otherVariable" [value]="thirdVariable"/>
<app-root>
{=html}, which we saw in line 12 of index.html. The tag can also be used in any files that import the AppComponent class. 2. Line 5 imports app.component.html, which we examined above. 3. Line 6 imports app.component.css, which applies styling to the HTML file. (If you set a different color for the Welcome to… sentence in the Try It tasks, this is why changing the css file worked). 4. Line 8 makes the AppComponent class available to other files.<app-root>
tag essentially says "Display all the content from the app
folder here."<app-root>
{=html}</app-root>
{=html}
<app-orbit-list [satellites]="sourceList">
{=html}</app-orbit-list>
{=html}<app-orbit-list [satellites]="sourcelist">
{=html}</app-orbit-list>
{=html}.<li *ngfor="let movie of movies">
{=html} ¶ {{movie}} ¶ </li>
{=html}<sometag *ngif="condition; else variableName">
{=html} <!-- HTML tags and content --->
{=html} </sometag>
{=html} <ng-template #variablename>
{=html} <!-- Alternate HTML tags and content --->
{=html} </ng-template>
{=html}<ng-template>
{=html}</ng-template>
{=html} is a special Angular element. It contains content that might be required for a web page. When the else statement in line 1 executes, Angular searches for an ng-template block labeled with the matching variable name. Angular then ignores the original div tags and anything they contain, and it replaces that content with lines 9 - 14.<ol [style.color]="alternateColor" [type]="bulletType">
style
attribute has different properties that can be assigned using dot notation. Examples include style.color
and style.background
. For properties with two-word labels, like text-align
, the data-binding syntax accepts either hyphens or camel case (style.text-align
or style.textAlign
).<tag (event)="statement">
{=html}</tag>
{=html}
<button (click)="addData(arguments)">
{=html} ¶ Submit ¶ </button>
{=html}<input #newmovie (keyup.enter)="true" type="text" placeholder="Enter Movie Title Here">
{=html}</input>
{=html} ¶ <button (click)="true">
{=html} ¶ Add ¶ </button>
{=html} ¶ {{newMovie.value}}