Adding module “angular-hotkeys” to my mean.js app

271 views
Skip to first unread message
Assigned to salman...@gmail.com by me

Salman Suhail

unread,
Sep 8, 2014, 12:01:49 AM9/8/14
to mea...@googlegroups.com

Just getting started with angular - so hoping I am not missing something absolutely obvious. I am using mean.js and working on a simple to do app to get me started. I am trying to add the angular-hotkeys module to my app.

(I had a lot of trouble understanding specifically what I had to do to add a new module from github into my mean.js app, even after reading the documentation (which focused more on writing my own module)- if I figure this out happy to add it to the documentation).  Also on StackOverflow here:  http://stackoverflow.com/questions/25706942/adding-module-angular-hotkeys-to-my-mean-js-app

I installed the module using sudo npm install -g angular-hotkeys --save

I then added ApplicationConfiguration.registerModule('cfp.hotkeys'); to my core.client.module.js file.

And in my config.js file, I added cfp.hotkeys as a dependency:

var ApplicationConfiguration = (function() {



 
// Init module configuration options

 
var applicationModuleName = 'taskmanager';

 
var applicationModuleVendorDependencies = ['ngResource', 'ngCookies',  'ngAnimate',  'ngTouch',  'ngSanitize',  'ui.router', 'ui.bootstrap', 'ui.utils', 'cfp.hotkeys'];



Finally - I bound hotkeys to my controller:

// Lists controller
angular.module('lists').controller('ListsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Lists', 'SelectedList', 'hotkeys',
    function($scope, $stateParams, $location, Authentication, Lists, SelectedList, hotkeys ) {
        $scope.authentication = Authentication;

        console.log('hotkeys');

But every time I load the page I get the following error:

Error: [$injector:unpr] Unknown provider: hotkeysProvider <- hotkeys http://errors.angularjs.org/1.2.22/$injector/unpr?p0=hotkeysProvider%20%3C-%20hotkeys
    at http://localhost:3000/lib/angular/angular.js:78:12
    at http://localhost:3000/lib/angular/angular.js:3792:19
    at Object.getService [as get] (http://localhost:3000/lib/angular/angular.js:3920:39)
    at http://localhost:3000/lib/angular/angular.js:3797:45
    at getService (http://localhost:3000/lib/angular/angular.js:3920:39)
    at invoke (http://localhost:3000/lib/angular/angular.js:3947:13)
    at Object.instantiate (http://localhost:3000/lib/angular/angular.js:3967:23)
    at http://localhost:3000/lib/angular/angular.js:7260:28
    at http://localhost:3000/lib/angular/angular.js:6651:34
    at forEach (http://localhost:3000/lib/angular/angular.js:332:20) <section data-ui-view="" class="ng-scope">


I know I am probably doing something very simple wrong - but for the life of me I can't figure out what it is.





Brandon Fitzpatrick

unread,
Jan 29, 2015, 11:11:26 AM1/29/15
to mea...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages