Skip to content

Instantly share code, notes, and snippets.

View zhentian-wan's full-sized avatar
🇫🇮
Working from home

Zhentian Wan zhentian-wan

🇫🇮
Working from home
View GitHub Profile
@zhentian-wan
zhentian-wan / index.html
Last active March 24, 2016 08:55
Angular 1.5 Multi Transcludion
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="app" ng-controller="AppCtrl as main">
<ng-details>
@zhentian-wan
zhentian-wan / index.html
Last active March 17, 2016 17:12
RxJS Demo 1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.1/dist/global/Rx.umd.js"></script>
<script src="script.js"></script>
<title>JS Bin</title>
</head>
<body>
@zhentian-wan
zhentian-wan / src\index.html
Last active March 18, 2016 08:54
Angular 2 -- Component directives
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<title>Intro to Angular 2</title>
<base href="/">
</head>
<body>
<app></app>
<script src="vendor.bundle.js"></script>
@zhentian-wan
zhentian-wan / main.ts
Created March 18, 2016 13:04
Angular 2 Event and ref
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
@Component({
selector: 'app',
template: `
<div>
<input type="text" #myInput/>
<button (click)="onClick(myInput.value)">Click Me</button>"
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 19, 2016 19:36
Inject service TypeScript way
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
@Component({
selector: 'todo-input',
template: `
<div>
<input #myInput type="text">
<button (click)="onClick(myInput.value)">Click me</button>
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 20, 2016 17:32
Angular 2 ngFor
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
@Component({
selector: 'todo-input',
template: `
<div>
<input #myInput type="text">
<button (click)="onClick(myInput.value)">Click me</button>
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 20, 2016 18:10
Angular 2 Create a TodoModel
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
import {TodoModule} from './TodoModule';
@Component({
selector: 'todo-input',
template: `
<form (submit)="onSubmit()">
<input type="text" [(ngModel)]="todoModule.title">
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 21, 2016 08:30
Angular 2 property syntax
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
import {TodoModule} from './TodoModule';
@Component({
selector: 'todo-input',
template: `
<form (submit)="onSubmit()">
<input type="text" [(ngModel)]="todoModule.title">
</form>
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 21, 2016 12:22
Angular 2 Pipe
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
import {TodoModule} from './TodoModule';
@Component({
selector: 'todo-input',
template: `
<form (submit)="onSubmit()">
<input type="text" [(ngModel)]="todoModule.title">
</form>
@zhentian-wan
zhentian-wan / TodoInput.ts
Created March 21, 2016 12:34
Angular 2 Pipe domo 2
import {Component} from 'angular2/core';
import {TodoService} from './TodoService';
import {TodoModule} from './TodoModule';
@Component({
selector: 'todo-input',
template: `
<form (submit)="onSubmit()">
<input type="text" [(ngModel)]="todoModule.title">
</form>