This file contains hidden or 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
<?php | |
$html = '<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
</head> | |
<body> | |
<p style="font-family: Arial, sans-serif;">ěščřžýáíé</p> | |
</body> | |
</html>'; |
This file contains hidden or 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
<md-input-container> | |
<input mdInput placeholder="State" [mdAutocomplete]="auto" [formControl]="stateCtrl"> | |
</md-input-container> | |
<md-autocomplete #auto="mdAutocomplete" [displayWith]="parseHash.bind(this)"> | |
<md-option *ngFor="let state of filteredStates | async" [value]="state"> | |
{{ state }} | |
</md-option> | |
</md-autocomplete> |
This file contains hidden or 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: 'auto-complete', | |
templateUrl: 'auto-complete.template.html', | |
}) | |
export class AutocompleteExample { | |
... | |
parseHash(val: string) { |
This file contains hidden or 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
<ul class="child"> | |
<li *ngFor="let child of children"> | |
{{child.name}} | |
<my-tree *ngIf="child.children" [children]="child.children"></my-tree> | |
</li> | |
</ul> |
This file contains hidden or 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
<my-tree [children]="tree"></my-tree> |
This file contains hidden or 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
... | |
<form [formGroup]="heroForm" (ngSubmit)="onSubmit()" novalidate> | |
<div style="margin-bottom: 1em"> | |
<button type="submit" | |
[disabled]="heroForm.pristine || name.invalid" class="btn btn-success">Save</button> | |
<button type="reset" (click)="revert()" | |
[disabled]="heroForm.pristine" class="btn btn-danger">Clear</button> | |
</div> |
This file contains hidden or 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: 'hero-detail', | |
templateUrl: './hero-detail.component.html' | |
}) | |
export class HeroDetailComponent implements OnChanges { | |
heroForm: FormGroup; |
This file contains hidden or 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
... | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
ReactiveFormsModule // <-- #2 add to @NgModule imports | |
], | |
... | |
}) |
This file contains hidden or 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
var array = [1, 1, 1]; | |
var current = 0; | |
var result; | |
for (var i=0, len=array.length; i<len;i++) { | |
current += array[i]; | |
} | |
result = current; | |
console.log(result); // logs 3 |
This file contains hidden or 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
var array = [1, 1, 1]; | |
var result; | |
result = array.reduce((current, next) => { | |
return current + next; | |
}) | |
console.log(result); // logs 3 |