Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9275145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:31:07+00:00 2026-06-18T16:31:07+00:00

I am using angular js, I have written code in two different jsp files.showing

  • 0

I am using angular js, I have written code in two different jsp files.showing two different views.
if I render single view it works fine.but if I render both views on same page I got this error

Error: Argument 'UserCtrl' is not a function, got undefined

the js code snippet in jsp’s is as follows.

in my first jsp file is

// Bootstrap the Application
var App = angular.module('module', []);
// Set up a controller and define a model
App.controller('UserCtrl', function($scope) {
    $scope.user = {};
    jQuery.get("<c:url value='${someUrl}'/>",
            function(data) {
            angular.element('#user_detail').scope().user = data;
            angular.element('#user_detail').scope().$apply();
}, "json");
});

and in the second one is

// Bootstrap the Application
var App = angular.module('module', []);

// Set up a controller and define a model
App.controller('ProfileCtrl', function($scope) {
    $scope.profile = {};
    jQuery.get("<c:url value='${someUrl}'/>",
            function(data) {
            angular.element('#profile').scope().profile = data;
            angular.element('#profile').scope().$apply();
}, "json");
});

I tried giving distinct names to modules but that too did not worked for me.any help is appreciated.
thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:31:09+00:00Added an answer on June 18, 2026 at 4:31 pm

    got it worked. It was due to the ng-app variable, i have binded it on both jsp pages.So now i binded it to the main body wrapper for both the jsp’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the code I have written with angular js. using jquery I want
I have created a simple code editor using Angular JS & old fashioned JavaScript
I have issue using Gruntfile.js, when the javascript files src path are started with
I have the following controller : angular.module('samples.controllers',[]) .controller('MainCtrl', ['$scope', 'Samples', function($scope, Samples){ //Controller code
I just started using angular.js , and it is pretty useful. I have searched
I have a fairly simple, 2-page web app. using Angular and Lawnchair. I have
I'm creating two POST calls. One using a django form and one using angular
I want to have element where i can have 2 views using their own
I have an chtml page using Angular Js that contains list with objects from
I have begun with the code from angular-seed , and am slowly changing it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.