2017-06-15 1 views
1

J'utilise le ngtable dans ma demande AngularJS mais lorsque vous faites construire rébarbatives, les références sont manquantes et il indique l'erreurngTable dans l'application AngularJS

Uncaught Error: [$injector:modulerr] Failed to instantiate module parts360App due to: 
Error: [$injector:modulerr] Failed to instantiate module ngTable due to: 
Error: [$injector:nomod] Module 'ngTable' 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. 
http://errors.angularjs.org/1.6.4/$injector/nomod?p0=ngTable 
    at http://localhost:9000/bower_components/angular/angular.js:66:12 

Le tableau que je utilise - http://ng-table.com/#/

bower install ng-table --save 

bower.json est mis à jour mais la référence de la table n'est pas disponible dans l'index.html

J'ai également essayé avec npm mais il montre une erreur sur l'invite de commande:

+-- UNMET PEER DEPENDENCY [email protected]^1.2 
`-- [email protected] 

npm WARN [email protected] requires a peer of [email protected]^1.2 but none was installed. 

Ceci est mon bower.json:

{ 
    "name": "parts360", 
    "version": "0.0.0", 
    "dependencies": { 
    "angular": "^1.4.0", 
    "bootstrap": "^3.2.0", 
    "angular-resource": "^1.4.0", 
    "angular-route": "^1.4.0", 
    "angular-bootstrap": "^2.5.0", 
    "angular-busy": "^4.1.4", 
    "ng-table": "^3.0.1" 
    }, 
    "devDependencies": { 
    "angular-mocks": "^1.4.0" 
    }, 
    "appPath": "app", 
    "moduleName": "parts360App", 
    "overrides": { 
    "bootstrap": { 
     "main": [ 
     "less/bootstrap.less", 
     "dist/css/bootstrap.css", 
     "dist/js/bootstrap.js" 
     ] 
    } 
    } 
} 

S'il vous plaît suggérer comment résoudre ce pour obtenir les références dans index.html

comme les autres:

<!-- build:js(.) scripts/vendor.js --> 
    <!-- bower:js --> 
    <script src="bower_components/jquery/dist/jquery.js"></script> 
    <script src="bower_components/angular/angular.js"></script> 
    <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> 
    <script src="bower_components/angular-resource/angular-resource.js"></script> 
    <script src="bower_components/angular-route/angular-route.js"></script> 
    <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> 
    <script src="bower_components/angular-animate/angular-animate.js"></script> 
    <script src="bower_components/angular-busy/dist/angular-busy.js"></script> 
    <!-- endbower --> 

    <!-- endbuild --> 

    <!-- build:js({.tmp,app}) scripts/scripts.js --> 

Répondre

1

Malheureusement ng-table n'est plus supporté sur bower.

Vous pouvez trouver tous les UpToDate installations methods sur leur github.

Si vous voulez vraiment/doivent utiliser Bower, vous pouvez utiliser:

bower install ng-table-bundle 

et ajouter la référence à, comme d'autres composants Bower:

<script src="bower_components/ng-table-bundle/ng-table.min.js"></script>