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 {Component} from 'angular2/core'; | |
import {bootstrap} from 'angular2/platform/browser'; | |
@Component({ | |
selector: 'hello-world', | |
template: `<input placeholder="Type Hello World !" | |
(keyup)="hello(input.value)" #input> {{message}}` | |
}) | |
export class HelloWorld { |
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
console.log('Hello Gist World!'); |
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: 'hello-world', | |
template: `<input #input (keydown)="updateModel(input.value)">{{model.message}}` | |
}) | |
export class HelloWorld { | |
model = { | |
message: 'Hello World !' | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Really Understanding Angular 2 - The Fundamentals</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> | |
<link href="//fonts.googleapis.com/css?family=Roboto:400,300,500,400italic,700" rel="stylesheet" type="text/css"> | |
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | |
<link rel="stylesheet" href="https://angular-academy.s3-us-west-1.amazonaws.com/styles/angular-academy-lessons-theme-v1.css"> |
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: 'app', | |
template: ` | |
<div class="color-sample" [style.background]="'red'"> | |
Color Sample</div> | |
<button [disabled]="true">Disabled</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
import {Component} from "@angular/core"; | |
import {bootstrap} from "@angular/platform-browser-dynamic"; | |
@Component({ | |
selector: 'app', | |
template: ` | |
<label>Message:</label>{{ model?.message }} | |
` | |
}) |
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: 'app', | |
template: ` | |
<input value="Hello World !" #input>{{input.value}} | |
<button (click)="onClick()">Click Me</button> | |
` | |
}) | |
export class App { | |
onClick() { |
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: 'color-picker', | |
template: ` | |
<div class="color-title" [ngStyle]="{color:color}">Pick a Color:</div> | |
<div class="color-picker"> | |
<div class="color-sample color-sample-blue" (click)="choose('${BLUE}')"></div> | |
<div class="color-sample color-sample-red" (click)="choose('${RED}')"></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
@Component({ | |
selector: 'app', | |
directives: [Hero, Heroes], | |
template: ` | |
<heroes> | |
<hero id="1" name="Superman"></hero> | |
<hero id="2" name="Batman"></hero> | |
<hero id="3" name="Batgirl"></hero> | |
<hero id="3" name="Robin"></hero> | |
<hero id="4" name="Flash"></hero> |
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: 'app', | |
directives: [Hero, Heroes], | |
template: ` | |
<heroes> | |
<hero id="1" name="Superman"></hero> | |
<hero id="2" [name]="'Batman'"></hero> | |
<hero id="3" [name]="'Spiderman'" marvel="true"></hero> | |
<hero id="4" name="Batgirl"></hero> | |
<hero id="3" name="Hulk" marvel="true"></hero> |
OlderNewer