質問編集履歴
4
バージョンの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
###前提・実現したいこと
|
2
2
|
yoemanのangular fullstack generator を使ってtwitter風のアプリケーションを作りたい。
|
3
3
|
###発生している問題・エラーメッセージ
|
4
|
-
generatorで作成されたソースコードがangular1.5でよく分からない。
|
4
|
+
generatorで作成されたソースコードがangular1.5でよく分からない。
|
5
5
|
```
|
6
6
|
エラーメッセージ
|
7
7
|
ReferenceError: Auth is not defined
|
@@ -330,8 +330,6 @@
|
|
330
330
|
[twitte風のアプリケーションを作る](http://paiza.hatenablog.com/entry/2015/07/09/1%E6%99%82%E9%96%93%E3%81%A7Twitter%E9%A2%A8%E3%83%95%E3%83%AB%E3%82%B9%E3%82%BF%E3%83%83%E3%82%AF%E3%83%BBWeb%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%82%92%E4%BD%9C%E3%82%8B%EF%BC%81-_MEAN%E3%82%B9)
|
331
331
|
|
332
332
|
このサイトを参考に作りましたが、angularjsのバージョンが古い時のもので書かれています。
|
333
|
-
今。バージョン1.5で描き直してみたんですが、どうも、お気に入り機能でつまづきました。
|
334
|
-
|
335
333
|
main.htmlで
|
336
334
|
<button ng-if="$ctrl.isMyTweet(thing)" type="button" class="close" ng-click="$ctrl.deleteThing(thing)">×</button>
|
337
335
|
|
@@ -352,10 +350,12 @@
|
|
352
350
|
});
|
353
351
|
};
|
354
352
|
```
|
355
|
-
|
356
|
-
|
357
353
|
この部分のawesomeThingsがundefinedというエラーがブラウザのconsoleに出てしまいます。
|
354
|
+
どなたか、どこが違うのか、
|
355
|
+
または、この参考にしたサイトのangular1.5の書き方で教えてくれないでしょうか。
|
358
356
|
|
359
|
-
|
357
|
+
バージョンは
|
360
|
-
|
358
|
+
node v6.3.1
|
359
|
+
npm v3.10.6
|
361
|
-
|
360
|
+
generator-angular-fullstack@4.0.0-rc.0
|
361
|
+
です。
|
3
ミス修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -70,7 +70,7 @@
|
|
70
70
|
this.$http = $http;
|
71
71
|
this.socket = socket;
|
72
72
|
this.$scope = $scope;
|
73
|
-
|
73
|
+
this.Auth = Auth;
|
74
74
|
|
75
75
|
this.isLoggedIn = Auth.isLoggedIn;
|
76
76
|
this.getCurrentUser = Auth.getCurrentUser;
|
2
見えやすく
title
CHANGED
File without changes
|
body
CHANGED
@@ -338,7 +338,7 @@
|
|
338
338
|
このように記述しましたが、認証されても、ボタンんが表示されない。
|
339
339
|
|
340
340
|
ng-ifを消して、とりあえずお気に入りボタンを押してみたら
|
341
|
-
|
341
|
+
```ここに言語を入力
|
342
342
|
starThing(thing) {
|
343
343
|
this.$http.put('/api/things/' + thing._id + '/star').success(function(newThing){
|
344
344
|
this.awesomeThing[this.awesomeThings.indexOf(thing)] = newThing;
|
@@ -351,13 +351,11 @@
|
|
351
351
|
this.awesomeThings[this.awesomeThings.indexOf(thing)] = newThing;
|
352
352
|
});
|
353
353
|
};
|
354
|
+
```
|
354
355
|
|
356
|
+
|
355
357
|
この部分のawesomeThingsがundefinedというエラーがブラウザのconsoleに出てしまいます。
|
356
358
|
|
357
359
|
|
358
360
|
どなたか、どこが違うのか、
|
359
|
-
または、この参考にしたサイトのangular1.5の書き方で教えてくれないでしょうか。
|
361
|
+
または、この参考にしたサイトのangular1.5の書き方で教えてくれないでしょうか。
|
360
|
-
|
361
|
-
|
362
|
-
###補足情報(言語/FW/ツール等のバージョンなど)
|
363
|
-
より詳細な情報
|
1
わかりやすく
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
```ここに言語を入力
|
11
11
|
|
12
|
-
|
12
|
+
```ここに言語を入力
|
13
13
|
[client/app/main/main.html]
|
14
14
|
|
15
15
|
<header class="hero-unit" id="banner">
|
@@ -54,7 +54,9 @@
|
|
54
54
|
</div>
|
55
55
|
</div>
|
56
56
|
|
57
|
-
|
57
|
+
```ここに言語を入力
|
58
|
+
コード
|
59
|
+
```
|
58
60
|
[client/app/main/main.component.js]
|
59
61
|
|
60
62
|
import angular from 'angular';
|
@@ -137,6 +139,9 @@
|
|
137
139
|
controller: MainController
|
138
140
|
})
|
139
141
|
.name;
|
142
|
+
```ここに言語を入力
|
143
|
+
コード
|
144
|
+
```
|
140
145
|
|
141
146
|
|
142
147
|
[server/api/thing/thing.controller.js:]
|
@@ -290,8 +295,10 @@
|
|
290
295
|
}
|
291
296
|
}
|
292
297
|
|
298
|
+
```ここに言語を入力
|
299
|
+
コード
|
300
|
+
```
|
293
301
|
|
294
|
-
|
295
302
|
[server/api/thing/index.js:]
|
296
303
|
|
297
304
|
'use strict';
|
@@ -311,15 +318,16 @@
|
|
311
318
|
router.put('/:id/star', auth.isAuthenticated(), controller.star);
|
312
319
|
router.delete('/:id/star', auth.isAuthenticated(), controller.unstar);
|
313
320
|
|
314
|
-
module.exports = router;
|
321
|
+
module.exports = router;```
|
315
322
|
|
316
323
|
|
317
324
|
|
325
|
+
|
318
326
|
```
|
319
327
|
|
320
328
|
###試したこと
|
321
329
|
課題に対してアプローチしたことを記載してください
|
322
|
-
http://paiza.hatenablog.com/entry/2015/07/09/1%E6%99%82%E9%96%93%E3%81%A7Twitter%E9%A2%A8%E3%83%95%E3%83%AB%E3%82%B9%E3%82%BF%E3%83%83%E3%82%AF%E3%83%BBWeb%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%82%92%E4%BD%9C%E3%82%8B%EF%BC%81-_MEAN%E3%82%B9
|
330
|
+
[twitte風のアプリケーションを作る](http://paiza.hatenablog.com/entry/2015/07/09/1%E6%99%82%E9%96%93%E3%81%A7Twitter%E9%A2%A8%E3%83%95%E3%83%AB%E3%82%B9%E3%82%BF%E3%83%83%E3%82%AF%E3%83%BBWeb%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%82%92%E4%BD%9C%E3%82%8B%EF%BC%81-_MEAN%E3%82%B9)
|
323
331
|
|
324
332
|
このサイトを参考に作りましたが、angularjsのバージョンが古い時のもので書かれています。
|
325
333
|
今。バージョン1.5で描き直してみたんですが、どうも、お気に入り機能でつまづきました。
|