質問編集履歴
2
ソース削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,30 +42,6 @@
|
|
42
42
|
|
43
43
|
1.コマンドプロンプトにて、サブジェネレータを利用してrouteを作成
|
44
44
|
|
45
|
-
以下、実行時のyoコマンドと、選択したオプション、実行時ログです。
|
46
|
-
|
47
|
-
c:\sample>yo angular-fullstack:route components
|
48
|
-
|
49
|
-
? What module name would you like to use? sampleApp
|
50
|
-
|
51
|
-
? Where would you like to create this route? client/app/
|
52
|
-
|
53
|
-
? What will the url of your route be? /components
|
54
|
-
|
55
|
-
create client\app\components\components.ts
|
56
|
-
|
57
|
-
create client\app\components\components.controller.ts
|
58
|
-
|
59
|
-
create client\app\components\components.controller.spec.ts
|
60
|
-
|
61
|
-
create client\app\components\components.css
|
62
|
-
|
63
|
-
create client\app\components\components.html
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
c:\sample>
|
68
|
-
|
69
45
|
|
70
46
|
|
71
47
|
■grunt起動
|
@@ -93,123 +69,3 @@
|
|
93
69
|
yo angular-fullstack:route componentsを実行して作成されたrouteに対して、
|
94
70
|
|
95
71
|
controllerが作成されてないのでは。。。と思うのですが。。。
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
サブジェネレータを使用して出力されたソースは以下のものです。
|
100
|
-
|
101
|
-
■components.controller.spec.ts
|
102
|
-
|
103
|
-
'use strict';
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
describe('Component: ComponentsComponent', function () {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
// load the controller's module
|
112
|
-
|
113
|
-
beforeEach(module('sampleApp'));
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
var ComponentsComponent, scope;
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
// Initialize the controller and a mock scope
|
122
|
-
|
123
|
-
beforeEach(inject(function ($componentController, $rootScope) {
|
124
|
-
|
125
|
-
scope = $rootScope.$new();
|
126
|
-
|
127
|
-
ComponentsComponent = $componentController('ComponentsComponent', {
|
128
|
-
|
129
|
-
$scope: scope
|
130
|
-
|
131
|
-
});
|
132
|
-
|
133
|
-
}));
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
it('should ...', function () {
|
138
|
-
|
139
|
-
expect(1).toEqual(1);
|
140
|
-
|
141
|
-
});
|
142
|
-
|
143
|
-
});
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
■components.controller.ts
|
148
|
-
|
149
|
-
'use strict';
|
150
|
-
|
151
|
-
(function(){
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
class ComponentsComponent {
|
156
|
-
|
157
|
-
constructor() {
|
158
|
-
|
159
|
-
this.message = 'Hello';
|
160
|
-
|
161
|
-
}
|
162
|
-
|
163
|
-
}
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
angular.module('sampleApp')
|
168
|
-
|
169
|
-
.component('components', {
|
170
|
-
|
171
|
-
templateUrl: 'app/components/components.html',
|
172
|
-
|
173
|
-
controller: ComponentsComponent
|
174
|
-
|
175
|
-
});
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
})();
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
■components.css
|
184
|
-
|
185
|
-
空ファイルでした。
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
■components.html
|
190
|
-
|
191
|
-
<div>This is the components view.</div>
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
■components.ts
|
196
|
-
|
197
|
-
'use strict';
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
angular.module('sampleApp')
|
202
|
-
|
203
|
-
.config(function ($stateProvider) {
|
204
|
-
|
205
|
-
$stateProvider
|
206
|
-
|
207
|
-
.state('components', {
|
208
|
-
|
209
|
-
url: '/components',
|
210
|
-
|
211
|
-
template: '<components></components>'
|
212
|
-
|
213
|
-
});
|
214
|
-
|
215
|
-
});
|
1
サブジェネレータを使用して出力されたソースを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -93,3 +93,123 @@
|
|
93
93
|
yo angular-fullstack:route componentsを実行して作成されたrouteに対して、
|
94
94
|
|
95
95
|
controllerが作成されてないのでは。。。と思うのですが。。。
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
サブジェネレータを使用して出力されたソースは以下のものです。
|
100
|
+
|
101
|
+
■components.controller.spec.ts
|
102
|
+
|
103
|
+
'use strict';
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
describe('Component: ComponentsComponent', function () {
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
// load the controller's module
|
112
|
+
|
113
|
+
beforeEach(module('sampleApp'));
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
var ComponentsComponent, scope;
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
// Initialize the controller and a mock scope
|
122
|
+
|
123
|
+
beforeEach(inject(function ($componentController, $rootScope) {
|
124
|
+
|
125
|
+
scope = $rootScope.$new();
|
126
|
+
|
127
|
+
ComponentsComponent = $componentController('ComponentsComponent', {
|
128
|
+
|
129
|
+
$scope: scope
|
130
|
+
|
131
|
+
});
|
132
|
+
|
133
|
+
}));
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
it('should ...', function () {
|
138
|
+
|
139
|
+
expect(1).toEqual(1);
|
140
|
+
|
141
|
+
});
|
142
|
+
|
143
|
+
});
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
■components.controller.ts
|
148
|
+
|
149
|
+
'use strict';
|
150
|
+
|
151
|
+
(function(){
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
class ComponentsComponent {
|
156
|
+
|
157
|
+
constructor() {
|
158
|
+
|
159
|
+
this.message = 'Hello';
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
angular.module('sampleApp')
|
168
|
+
|
169
|
+
.component('components', {
|
170
|
+
|
171
|
+
templateUrl: 'app/components/components.html',
|
172
|
+
|
173
|
+
controller: ComponentsComponent
|
174
|
+
|
175
|
+
});
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
})();
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
■components.css
|
184
|
+
|
185
|
+
空ファイルでした。
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
■components.html
|
190
|
+
|
191
|
+
<div>This is the components view.</div>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
■components.ts
|
196
|
+
|
197
|
+
'use strict';
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
angular.module('sampleApp')
|
202
|
+
|
203
|
+
.config(function ($stateProvider) {
|
204
|
+
|
205
|
+
$stateProvider
|
206
|
+
|
207
|
+
.state('components', {
|
208
|
+
|
209
|
+
url: '/components',
|
210
|
+
|
211
|
+
template: '<components></components>'
|
212
|
+
|
213
|
+
});
|
214
|
+
|
215
|
+
});
|