Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 35aa38d

Browse files
Add Angular.js 2.0 example.
1 parent 71f5e15 commit 35aa38d

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

‎angularjs-2/controllers/default.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.install = function() {
2+
F.route('/');
3+
};

‎angularjs-2/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('total.js').http('debug');

‎angularjs-2/views/index.html‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
@{layout('')}
2+
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<title>Angular.js 2.0</title>
7+
<meta charset="utf-8" />
8+
<meta http-equiv="X-UA-Compatible" content="IE=11" />
9+
<meta name="format-detection" content="telephone=no" />
10+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
11+
<meta name="robots" content="all,follow" />
12+
13+
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.umd.js"></script>
14+
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
15+
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-all.umd.dev.js"></script>
16+
17+
</head>
18+
<body>
19+
<company-app>
20+
Loading ...
21+
</company-app>
22+
23+
<script>
24+
(function() {
25+
26+
var HelloWorldComponent = function() {};
27+
28+
HelloWorldComponent.annotations = [
29+
new ng.core.Component({
30+
selector: 'hello-world',
31+
template: '<h1>Hello Angular2!</h1>'
32+
})
33+
];
34+
35+
var HelloFlentApi = ng.core.Component({
36+
selector: 'hello-fluent',
37+
template: '<h1>Hello {{name}}!</h1>' + '<input [(ngModel)]="name">',
38+
}).Class({
39+
constructor: function() {
40+
this.name = "Fluent API";
41+
}
42+
});
43+
44+
var AppComponent = ng.core.Component({
45+
selector: 'company-app',
46+
template: '<hello-world></hello-world>' +
47+
'<hello-fluent></hello-fluent>',
48+
directives: [HelloWorldComponent, HelloFlentApi]
49+
}).Class({
50+
constructor: function() {}
51+
});
52+
53+
document.addEventListener("DOMContentLoaded", function() {
54+
ng.platform.browser.bootstrap(AppComponent);
55+
});
56+
57+
}());
58+
</script>
59+
</body>
60+
</html>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /