Soy nuevo en AngularJS. En lugar de usar etiquetas de script para importar dependencias, instalé la dependencia usando npm y luego la agrupé en un archivo usando Webpack y solo importé eso. Pero estoy viendo este error.
bundle.js:2 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:nomod] Module 'myApp' 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.4.4/$injector/nomod?p0=myApp
Parece que angularjs de alguna manera no puede localizar el módulo myApp. Ver mi código a continuación.
aplicación.js
'use strict'; import angular from 'angular'; angular.module( 'myApp', []);
index.js para agrupar usando webpack (estas dependencias se instalan usando npm)
import 'angular'; import 'angular-route'; import './app/app.js';
índice.html
<!DOCTYPE html > <html lang="en" ng-app="myApp"> <head> <title>My App</title> </head> <body> ... <!-- Angular --> <script src="dist/bundle.js"></script> </body> </html>