index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<
html
lang
=
"en"
ng-app
=
"single_view"
>
<
head
>
<
script
src
=
"../jslib/angular.js"
></
script
>
<
script
src
=
"../jslib/angular-route.js"
></
script
>
<
script
src
=
"app.js"
></
script
>
</
head
>
<
body
>
<
h4
>below is the a page informaiton</
h4
>
<
div
ng-include
=
"'view/a.html'"
></
div
>
<
h4
>below is the b page informaiton</
h4
>
<
div
ng-include
=
"'view/b.html'"
></
div
>
</
body
>
</
html
>
|
app.js
1
|
angular.module(
'single_view'
, []);
|
view/a.html
1
|
A page ...
|
view/b.html
1
|
B page ...
|
注:<div ng-include="'view/b.html'"></div> 要加单引号
本文转自 antlove 51CTO博客,原文链接:http://blog.51cto.com/antlove/1658003