Невозможно использовать сервис с последней версией генератора Angular-fullstack

Я только что обновил свой генератор полного стека Angular с 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

Как это решить? Спасибо !


person Emidomenge    schedule 27.05.2016    source источник


Ответы (1)


В соответствии с этим я удалил .myService которые дают мне это сейчас:

'use strict';

angular.module('myProjectApp')
  .service('myService', function () {
    // AngularJS will instantiate a singleton by calling "new" on this function
  });

Это работает сейчас!

person Emidomenge    schedule 27.05.2016