asp.net mvc 4 - MVC4 after bundling angularjs not working throwing exception -
in mvc4 application working fine angularjs , have no errors.if bundle js , css using
bundletable.enableoptimizations = true;
i got uncaught error. http://errors.angularjs.org/1.3.15/$injector/modulerr?p0
controller.js
app.controller('usercontroller', ['$rootscope', '$scope', '$state', 'exdialog', '$stateparams', 'toaster', 'upload', '$modal', function ($rootscope, $scope, $state, exdialog, $stateparams, toaster, upload, $modal) { //logic here }]);
solution
the issue while minification. directive names changed single characters minification.
issue js finding method
public class nonminifying : ibundletransform { public void process(bundlecontext context, bundleresponse bundle) { if (bundle == null) { throw new argumentnullexception("bundle"); } //context.httpcontext.response.cache.setlastmodifiedfromfiledependencies(); foreach (var file in bundle.files) { httpcontext.current.response.addfiledependency(httpcontext.current.request.mappath(file.includedvirtualpath)); } } }
create bundle below code , bundle js 1 one this.if worked fine change next js found issue line.hope above details find issue line in js
bundles.add(new bundle("~/bundles/appscriptsnonmini", new nonminifying()) .includedirectory("~/scripts/app", "*.js") );
Comments
Post a Comment