Last active
March 18, 2016 08:54
-
-
Save zhentian-wan/5abea82a522413618cdd to your computer and use it in GitHub Desktop.
Angular 2 -- Component directives
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> | |
<meta charset=UTF-8> | |
<title>Intro to Angular 2</title> | |
<base href="/"> | |
</head> | |
<body> | |
<app></app> | |
<script src="vendor.bundle.js"></script> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
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/bootstrap'; | |
import {TodoInput} from './todo-input'; | |
@Component({ | |
selector: 'app', | |
directives: [TodoInput], | |
template: `<todo-input></todo-input>` | |
}) | |
class App{ | |
} | |
bootstrap(App); |
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'; | |
@Component({ | |
selector: 'todo-input', | |
template: `<input type="text"/>` | |
}) | |
export class TodoInput{ | |
} |
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/bootstrap'; | |
import {TodoInput} from './todo-input'; | |
@Component({ | |
selector: 'app', | |
directives: [TodoInput], | |
template: `<todo-input></todo-input>` | |
}) | |
class App{ | |
} | |
bootstrap(App); |
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'; | |
@Component({ | |
selector: 'todo-input', | |
template: `<input type="text"/>` | |
}) | |
export class TodoInput{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment