This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {of} from "rxjs"; | |
import {delay} from "rxjs/operators"; | |
function simulateHttp(val: any, delay:number) { | |
return of(val).pipe(delay(delay)); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"-KgVwEC-dwWkLO4ZsQ9e": { | |
"description": "Angular Tutorial For Beginners - Build Your First App - Hello World Step By Step", | |
"longDescription": "This is step by step guide to create your first Angular application. Its aimed at beginners just starting out with the framework.This lesson will show how to create a component, and how to link the component to a given custom HTML tag. It will show how to give the component a given template.", | |
"tags": "BEGINNER", | |
"url": "angular-hello-world-write-first-application", | |
"videoUrl": "https://www.youtube.com/embed/du6sKwEFrhQ" | |
}, | |
"-KgVwEC0vq_chg0dvlrb": { | |
"courseId": "-KgVwEBq5wbFnjj7O8Fp", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta charset="UTF-8"> | |
<head> | |
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css" | |
rel="stylesheet" type="text/css"/> | |
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> | |
<link rel="stylesheet" | |
href="https://angular-university.s3.amazonaws.com | |
/bundles/bundle.20170418144151.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'course-detail', | |
templateUrl: './course-detail.component.html' | |
}) | |
export class CourseDetailComponent implements OnInit { | |
user$: Observable<User>; | |
course$: Observable<Course>; | |
lessons$: Observable<Lesson[]>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'home', | |
template: ` | |
<newsletter [user]="user" (subscribe)="subscribe($event)"></newsletter> | |
<button (click)="changeUserName()">Change User Name</button> | |
`}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Thread { | |
id:number; | |
messageIds: number[]; | |
participants: {[key:number]: number}; | |
} | |
export interface Message { | |
id:number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngIf="condition else loading"> | |
<p>Condition is true ...</p> | |
</div> | |
<ng-template #loading> | |
<p>Condition is false ...</p> | |
</ng-template> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Course { | |
id:number; | |
description:string; | |
} | |
const course: Course = { | |
id: 1, | |
description: "Angular For Beginners" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="messages-frame" *ngIf="message"> | |
<div class="messages messages-error"> | |
<i class="md-icon close-icon" (click)="close()">close</i> | |
<div class="messages-container"> | |
<div>{{message}}</div> | |
</div> | |
</div> | |
</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let user = {}; | |
user.name = 'John'; | |