L35 - Angular
L35 - Angular
COS216
AVINASH SINGH
DEPARTMENT OF COMPUTER SCIENCE
UNIVERSITY OF PRETORIA
Open-source, released October 2016, latest
version 9.19
Cross Platform
End-to-end Testing
Testing file
Describes your component logic
@Component({
A component has 3 parts, an
selector: 'app-root',
Import, Decorator and a Class templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'demo';
}
Component
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Integrating Typescript with HTML
Up until now we saw how we can get data from TypeScript into HTML templates but what
if we want it to be bidirectional?
Angular Logic
You can also perform or show certain functionality based on conditions for example:
<p>home works!</p>
<input type="text" [(ngModel)]="name"><br>
Hi {{ name }}!
<button (click)="count()">Click Me</button>
<p>You have Clicked me {{ counter }} times.</p>
You can also perform or show certain functionality based on conditions for example:
<p>home works!</p>
<input type="text" [(ngModel)]="name"><br>
Hi {{ name }}!
<button (click)="count()">Click Me</button>
<p>You have Clicked me {{ counter }} times.</p>
There is a lot more about Angular that was not taught, but this serves as the foundations
that is needed such that we can tackle Hybrid Mobile.