質問編集履歴
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,143 @@
|
|
15
15
|
<ons-list-item ng-click="app.load('hoge.html')" tappable>
|
16
16
|
|
17
17
|
```
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
補正
|
22
|
+
|
23
|
+
以下がファイルとなります。この中の <ons-template id="mainhome.html">となっている箇所を別のファイルに移したいのですが、うまくいきません。
|
24
|
+
|
25
|
+
```ここに言語を入力
|
26
|
+
|
27
|
+
<!DOCTYPE HTML>
|
28
|
+
|
29
|
+
<html ng-app="myApp">
|
30
|
+
|
31
|
+
<head>
|
32
|
+
|
33
|
+
<meta charset="utf-8">
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<script>
|
38
|
+
|
39
|
+
var app = angular.module('myApp', ['onsen']);
|
40
|
+
|
41
|
+
app.controller('AppController', function($scope) {
|
42
|
+
|
43
|
+
this.load = function(page) {
|
44
|
+
|
45
|
+
$scope.splitter.content.load(page);
|
46
|
+
|
47
|
+
$scope.splitter.left.close();
|
48
|
+
|
49
|
+
};
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
this.toggle = function() {
|
54
|
+
|
55
|
+
$scope.splitter.left.toggle();
|
56
|
+
|
57
|
+
};
|
58
|
+
|
59
|
+
});
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
ons.ready(function() {
|
64
|
+
|
65
|
+
console.log("Onsen UI is ready!");
|
66
|
+
|
67
|
+
});
|
68
|
+
|
69
|
+
</script>
|
70
|
+
|
71
|
+
</head>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<body>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<ons-splitter ng-controller="AppController as app" var="splitter">
|
80
|
+
|
81
|
+
<ons-splitter-side side="left" width="220px" collapse swipeable>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<ons-page>
|
86
|
+
|
87
|
+
<ons-list>
|
88
|
+
|
89
|
+
<ons-list-item ng-click="app.load('mainhome.html')" tappable>
|
90
|
+
|
91
|
+
メインページ
|
92
|
+
|
93
|
+
</ons-list-item>
|
94
|
+
|
95
|
+
<ons-list-item ng-click="app.load('chat.html')" tappable>
|
96
|
+
|
97
|
+
ログイン中
|
98
|
+
|
99
|
+
</ons-list-item>
|
100
|
+
|
101
|
+
<ons-list-item ng-click="app.load('about.html')" tappable>
|
102
|
+
|
103
|
+
About
|
104
|
+
|
105
|
+
</ons-list-item>
|
106
|
+
|
107
|
+
</ons-list>
|
108
|
+
|
109
|
+
</ons-page>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</ons-splitter-side>
|
114
|
+
|
115
|
+
<ons-splitter-content page="mainhome.html"></ons-splitter-content>
|
116
|
+
|
117
|
+
</ons-splitter>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<ons-template id="mainhome.html">
|
122
|
+
|
123
|
+
<ons-page>
|
124
|
+
|
125
|
+
<ons-toolbar>
|
126
|
+
|
127
|
+
<div class="left">
|
128
|
+
|
129
|
+
<ons-toolbar-button ng-click="app.toggle()">
|
130
|
+
|
131
|
+
<ons-icon icon="md-menu"></ons-icon>
|
132
|
+
|
133
|
+
</ons-toolbar-button>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="center">
|
138
|
+
|
139
|
+
メインページ
|
140
|
+
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</ons-toolbar>
|
144
|
+
|
145
|
+
</ons-page>
|
146
|
+
|
147
|
+
</ons-template>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<ons-template id="chat.html">
|
154
|
+
|
155
|
+
。。。
|
156
|
+
|
157
|
+
```
|