我刚刚将我的Angular-fullstack生成器从3.0.0-rc9更新为3.7.0。
我创建了一个新项目:
yo angular-fullstack myProject
当我想创建新服务时遇到一些麻烦:
yo angular-fullstack:service myService
创建后,我的浏览器出现以下错误 :(这是我的问题)
angular.js:68
Uncaught Error: [$injector:nomod] Module 'myProjectApp.myService' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
它正确地注入index.html:
<script src="app/service/myService/myService.service.js"></script>
这里是myService.service.js的内容:(以防万一^^)
'use strict';
angular.module('myProjectApp.myService')
.service('myService', function () {
// AngularJS will instantiate a singleton by calling "new" on this function
});
我不知道它是否可能来自:(在凉亭安装期间)
Unable to find a suitable version for angular, please choose one by typing one of the numbers below:
1) angular#~1.2.0 which resolved to 1.2.29 and is required by ngSweetAlert#1.1.0
2) angular#~1.2.9 which resolved to 1.2.29 and is required by ng-ckeditor#0.2.1
3) angular#>=1.4.0 which resolved to 1.5.5 and is required by angular-bootstrap#1.1.2
4) angular#^1.2.0 which resolved to 1.5.5 and is required by ngSmoothScroll#2.0.0
5) angular#1.5.5 which resolved to 1.5.5 and is required by angular-animate#1.5.5
6) angular#~1.5.0 which resolved to 1.5.5 and is required by webapp2
7) angular#^1.2.6 which resolved to 1.5.5 and is required by angular-socket-io#0.7.0
8) angular#^1.0.8 which resolved to 1.5.5 and is required by angular-ui-router#0.2.18
9) angular#>=1.2.0 <2.0.0 which resolved to 1.5.5 and is required by angular-validation-match#1.5.2
10) angular#* which resolved to 1.5.5 and is required by angular-clipboard#1.4.2
Prefix the choice with ! to persist it to bower.json
? Answer 5
如何解决?谢谢!
答案 0 :(得分:0)
根据this,我删除了 .myService ,现在就给我这个:
public function assignUsername(Request $request)
{
$user_id = $request->user_id;
现在有效!