ElevenEleven
ElevenEleven

Reputation: 1

MEAN stack Angular service not being injected into application

I am relatively new to MEAN stack development having been working with it for the past few months. I have an issue I am trying to resolve that I have been researching extensively but cannot seem to get to the bottom of.

So, I have a MEAN stack application that I scaffolded using Yeomen. I created a route which has a view that I would like to show a record set using Angulars ng-repeat directive. I get the dataset via an http get call via an Angular service. However, when I run the app using Grunt I get the error:

Error: [$injector:nomod] Module 'Records' is not available!

I have put a reference to the service in my controller:

angular.module('recordsApp').controller('RecordsCtrl', function ($scope, $http, $filter, Records) {

I have also injected into it the app within the app.js file:

angular.module('recordsApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute',
'Records'
])

Can anyone please help point me in the right direction here as to what I am missing?

Thank you.

Upvotes: 0

Views: 250

Answers (1)

dark_ruby
dark_ruby

Reputation: 7865

You don't need to include 'Records' module as your module dependancy, as you only have a service called Records in the same module

angular.module('recordsApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])

Upvotes: 0

Related Questions