Angular - Failed to instantiate module myapp
<p>I am trying to create a simple Angular App, however every time i load the page in the application i am getting following error.</p>

<p>I have home page where I access the angular page using a menu which load the content of the page by a jQuery ajax call. When I do it this way i keep getting following error even though <code>myapp</code> is present and all required files are included.</p>

<p>Please note that when I access the URL of the page directly in a browser it works fine...this occurs only when I access this angular page from my home page using an ajax call. </p>

<pre><code>Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=myapp&amp;p1=Error%3A%2…jquery%2F2.2.4%2Fjquery.min.js%3A2%3A2640)%2C%20%3Canonymous%3E%3A20%3A359)
</code></pre>

<p>` </p>

<pre><code> Failed to instantiate module myapp due to:
Error: [$injector:nomod] http://errors.angularjs.org/1.5.7/$injector/nomod?p0=myapp
    at Error (native)
    at eval (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:6:412)
    at eval (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:25:72)
    at b (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:24:115)
    at eval (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:24:358)
    at eval (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:39:374)
    at r (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:7:355)
    at g (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:39:222)
    at db (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:43:246)
    at Bc.c (eval at &lt;anonymous&gt; (https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js:2:2640), &lt;anonymous&gt;:20:359 
</code></pre>

<p>`</p>

<p><strong>Contoller</strong>
`</p>

<pre><code>var myapp=angular.module('myapp',[]);
myapp.controller('UserConfigController',['$scope','$http', function($scope,$http){
    $http.get('/runquery/getdata/userconfig').success(function(data){ $scope.usrConf=data; });
}]);
</code></pre>

<p>`</p>

<p><strong>Page that has angular code</strong></p>

<pre><code>        &lt;script src="${pageContext.request.contextPath}/s/xxxx_static/js/thirdParty/angular.min.js"&gt;&lt;/script&gt;
        &lt;script src="${pageContext.request.contextPath}/s/xxxx_static/js/controllers/queryContorllers.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div ng-app="myapp"&gt;
&lt;input type="text" ng-model="name"&gt;
&lt;h2&gt;Welcome {{name}}&lt;/h2&gt;
    &lt;div ng-controller="UserConfigController"&gt;
    &lt;div ng-repeat="it in usrConf"&gt;
        &lt;h1&gt;{{it.propertyName}}&lt;/h1&gt;
    &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>