Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1398f0c

Browse files
committed
add directive "inherits", "layout" and "section".
1 parent f6fccaf commit 1398f0c

File tree

23 files changed

+5096
-10
lines changed

23 files changed

+5096
-10
lines changed

developing2/home/layout.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<html>
2+
<head><title>layout.html</title></head>
3+
<body>
4+
5+
@for(var i = 0; i < 5; i++) {
6+
<div><span style="color: #ac66ff; padding-right: 5px;">@i</span>@(new Date())</div>
7+
}
8+
@for(var i = 0; i < 5; i++) {
9+
<div><span style="color: #ac66ff; padding-right: 5px;">xxxxxxxxx</div>
10+
}
11+
@this.renderSection('xxxxxxx')
12+
<div style="margin: 10px 0; border: solid 1px #fc1212; padding: 15px;">
13+
@this.renderSection('first', true)
14+
</div>
15+
16+
<div style="margin: 30px 50px; background-color: #ececec; border: solid 1px #a8a8a8; padding: 30px; max-height: 500px; overflow-y: auto; width: 600px; ">
17+
18+
@this.renderContentPage()
19+
20+
</div>
21+
@for(var i = 0; i < 5; i++) {
22+
<div style="background-color: #ac8989"><span style="color: #ffffff; padding: 0 5px;">@i</span>@(new Date())</div>
23+
}
24+
25+
<div style="margin: 10px 0; border: solid 1px #12fc12; padding: 15px;">
26+
@this.renderSection('second')
27+
</div>
28+
</body>
29+
30+
</html>
31+
@section second{
32+
for(var i = 0; i++ < 5;) {
33+
<div>@i : section second. section second. section second.</div>
34+
}
35+
}

developing2/home/show.html

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
@layout ("layout")
12
@{
23
var time = new Date;
34
}
4-
<html>
5-
<head ;="" ) a=b />
6-
<title>@(time)</title>
7-
</head>
8-
<body>
5+
@section first{
6+
for(var i = 0; i++ < 5;) {
7+
<div>@i : section first. section first. section first.</div>
8+
}
9+
}
10+
<div>
11+
<div ;="" ) a=b />
12+
<span>time=@(time)</span>
13+
</div>
14+
<div style="background: #56ec26">
15+
<div>render section in page:</div>
16+
<div style="padding: 20px;">@this.renderSection('first')</div>
17+
</div>
18+
<div>
919
<p>viewModel=@viewModel</p>
1020
<p>first 1234567890</p>
1121
@{
@@ -24,8 +34,8 @@
2434
@(abcd + ' : ' + time)
2535

2636
<button onclick="alert(this.getAttribute('info'))" info="hello! @viewModel.name">click me</button>
27-
<div>@abcd[1 + 2 - 3 + 1]<div>
28-
<div>@func(abcd[1 + 2 - 3 + 1] + "gggg").length<div>
37+
<div>@abcd[1 + 2 - 3 + 1]</div>
38+
<div>@func(abcd[1 + 2 - 3 + 1] + "gggg").length</div>
2939

3040
@for(var i = 0; i < 5; i++){
3141
var s = "sss" + i;
@@ -64,6 +74,10 @@
6474
var s = "obj[" + i + "] = \"" + obj[i] + "\""<div style="padding:10px;">@s</DIV>
6575
}
6676
67-
</body>
68-
</html>
77+
</div>
78+
<div style="background: #5626ec">
79+
<div>render section in page:</div>
80+
<div style="padding: 20px;">@this.renderSection('second')</div>
81+
</div>
82+
</div>
6983
@{var end = "end"}@(end).@

developing2/node_modules/mvc

Lines changed: 0 additions & 1 deletion
This file was deleted.

developing2/node_modules/mvc/.gitignore

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

developing2/node_modules/mvc/.typings/http-assert/http-assert.d.ts

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

developing2/node_modules/mvc/.typings/koa/koa.d.ts

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)