Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grunt serve issue? #24

Open
yuens1002 opened this issue May 26, 2016 · 2 comments
Open

grunt serve issue? #24

yuens1002 opened this issue May 26, 2016 · 2 comments

Comments

@yuens1002
Copy link

yuens1002 commented May 26, 2016

hi there, i installed both font-awesome and angular-fontawesome via bower. i'm using grunt serve to preview my angular app on a browser and i'm getting

Error: [$injector:modulerr] Failed to instantiate module picardy.fontawesome due to:
Error: [$injector:nomod] Module 'picardy.fontawesome' 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.

in the console whenever i make a change in the index.html thus triggering grunt serve to refresh the index.html file. i verified that the bower.json file has angular-fontawesome listed as a dependency. i also added

<script src="bower_components/angular-fontawesome/dist/angularfontawesome.js"></script> 

tag in the index.html file to point to the js location.

@eliagrady
Copy link
Contributor

How is your angular.module defined? have you added the dependency for it like so?
var app = angular.module('MODULE_NAME',['picardy.fontawesome']); ?

@yuens1002
Copy link
Author

yuens1002 commented May 30, 2016

app.js

'use strict';

/**
 * @ngdoc overview
 * @name cookbriteApp
 * @description
 * # cookbriteApp
 *
 * Main module of the application.
 */
angular
  .module('cookbriteApp', [
    'ngAnimate',
    'ngAria',
    'ngCookies',
    'ngMessages',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ui.bootstrap',
    'ngStorage',
    'angularGrid',
    'picardy.fontawesome',
    'ngTouch'
  ])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl',
        controllerAs: 'main'
      })
      .when('/about', {
        templateUrl: 'views/about.html',
        controller: 'AboutCtrl',
        controllerAs: 'about'
      })
      .when('/save', {
        templateUrl: 'views/save.html',
        controller: 'SaveCtrl',
        controllerAs: 'save'
      })
      .otherwise({
        redirectTo: '/'
      });
  });

bower.json in project root

{
  "name": "cookbrite",
  "version": "0.0.0",
  "dependencies": {



    "angular": "^1.4.0",
    "bootstrap-sass-official": "^3.2.0",
    "angular-animate": "^1.4.0",
    "angular-aria": "^1.4.0",
    "angular-cookies": "^1.4.0",
    "angular-messages": "^1.4.0",
    "angular-resource": "^1.4.0",
    "angular-route": "^1.4.0",
    "angular-sanitize": "^1.4.0",
    "angular-touch": "^1.4.0",
    "angular-bootstrap": "^1.3.2",
    "ngstorage": "^0.3.10",
    "angulargrid": "^0.6.0",
    "font-awesome": "^4.6.3",
    "angular-fontawesome": "^1.0.0",
    "angular-masonry-directive": "*"
  },
  "devDependencies": {
    "angular-mocks": "^1.4.0"
  },
  "appPath": "app",
  "moduleName": "cookbriteApp",
  "overrides": {
    "bootstrap": {
      "main": [
        "less/bootstrap.less",
        "dist/css/bootstrap.css",
        "dist/js/bootstrap.js"
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants