• Jobs
  • About Us
  • Jobs
    • Home
    • Jobs
    • Courses and challenges
  • Businesses
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

337
Views
El módulo 'myApp' no está disponible en AngularJS con Webpack

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>
over 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Show me some job opportunities
There's an error!